diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 8d9a3b860d6fe..1fe1c11d7d659 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -335,6 +335,7 @@ com.azure.resourcemanager:azure-resourcemanager-automanage;1.0.0-beta.1;1.0.0-be com.azure.resourcemanager:azure-resourcemanager-edgeorder;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-securityinsights;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-oep;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-app;1.0.0-beta.1;1.0.0-beta.1 com.azure.tools:azure-sdk-archetype;1.0.0;1.0.0 # Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current diff --git a/pom.xml b/pom.xml index efafdfe5c9411..3c2cdb5210796 100644 --- a/pom.xml +++ b/pom.xml @@ -718,6 +718,7 @@ sdk/anomalydetector sdk/aot sdk/apimanagement + sdk/app sdk/appconfiguration sdk/applicationinsights sdk/attestation diff --git a/sdk/app/azure-resourcemanager-app/CHANGELOG.md b/sdk/app/azure-resourcemanager-app/CHANGELOG.md new file mode 100644 index 0000000000000..2f1bd3229888a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/CHANGELOG.md @@ -0,0 +1,5 @@ +# Release History + +## 1.0.0-beta.1 (2022-01-28) + +- Azure Resource Manager ContainerAppsApi client library for Java. This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-2022-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/app/azure-resourcemanager-app/README.md b/sdk/app/azure-resourcemanager-app/README.md new file mode 100644 index 0000000000000..336967abd6f57 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/README.md @@ -0,0 +1,102 @@ +# Azure Resource Manager ContainerAppsApi client library for Java + +Azure Resource Manager ContainerAppsApi client library for Java. + +This package contains Microsoft Azure SDK for ContainerAppsApi Management SDK. Package tag package-2022-01-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +## We'd love to hear your feedback + +We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better. + +If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together. + +Thank you in advance for your collaboration. We really appreciate your time! + +## Documentation + +Various documentation is available to help you get started + +- [API reference documentation][docs] + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-app;current}) +```xml + + com.azure.resourcemanager + azure-resourcemanager-app + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +### Include the recommended packages + +Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client. + +[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation. + +### Authentication + +By default, Azure Active Directory token authentication depends on correct configure of following environment variables. + +- `AZURE_CLIENT_ID` for Azure client ID. +- `AZURE_TENANT_ID` for Azure tenant ID. +- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate. + +In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`. + +With above configuration, `azure` client can be authenticated by following code: + +```java +AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +TokenCredential credential = new DefaultAzureCredentialBuilder() + .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) + .build(); +ContainerAppsApiManager manager = ContainerAppsApiManager + .authenticate(credential, profile); +``` + +The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. + +See [Authentication][authenticate] for more options. + +## Key concepts + +See [API design][design] for general introduction on design and key concepts on Azure Management Libraries. + +## Examples + +[Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/app/azure-resourcemanager-app/SAMPLE.md) + + +## Troubleshooting + +## Next steps + +## Contributing + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://docs.microsoft.com/java/azure/jdk/ +[azure_subscription]: https://azure.microsoft.com/free/ +[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity +[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty +[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md +[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md diff --git a/sdk/app/azure-resourcemanager-app/SAMPLE.md b/sdk/app/azure-resourcemanager-app/SAMPLE.md new file mode 100644 index 0000000000000..5d316b2f86b65 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/SAMPLE.md @@ -0,0 +1,788 @@ +# Code snippets and samples + + +## ContainerApps + +- [CreateOrUpdate](#containerapps_createorupdate) +- [Delete](#containerapps_delete) +- [GetByResourceGroup](#containerapps_getbyresourcegroup) +- [List](#containerapps_list) +- [ListByResourceGroup](#containerapps_listbyresourcegroup) +- [Update](#containerapps_update) + +## ContainerAppsRevisionReplicas + +- [GetReplica](#containerappsrevisionreplicas_getreplica) +- [ListReplicas](#containerappsrevisionreplicas_listreplicas) + +## ContainerAppsRevisions + +- [ActivateRevision](#containerappsrevisions_activaterevision) +- [DeactivateRevision](#containerappsrevisions_deactivaterevision) +- [GetRevision](#containerappsrevisions_getrevision) +- [ListRevisions](#containerappsrevisions_listrevisions) +- [RestartRevision](#containerappsrevisions_restartrevision) + +## ContainerAppsSourceControls + +- [CreateOrUpdate](#containerappssourcecontrols_createorupdate) +- [Delete](#containerappssourcecontrols_delete) +- [Get](#containerappssourcecontrols_get) +- [ListByContainerApp](#containerappssourcecontrols_listbycontainerapp) + +## ManagedEnvironments + +- [CreateOrUpdate](#managedenvironments_createorupdate) +- [Delete](#managedenvironments_delete) +- [GetByResourceGroup](#managedenvironments_getbyresourcegroup) +- [List](#managedenvironments_list) +- [ListByResourceGroup](#managedenvironments_listbyresourcegroup) +- [Update](#managedenvironments_update) + +## ManagedEnvironmentsStorages + +- [CreateOrUpdate](#managedenvironmentsstorages_createorupdate) +- [Delete](#managedenvironmentsstorages_delete) +- [Get](#managedenvironmentsstorages_get) +- [List](#managedenvironmentsstorages_list) + +## Operations + +- [List](#operations_list) +### ContainerApps_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AppProtocol; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.Container; +import com.azure.resourcemanager.app.models.CustomScaleRule; +import com.azure.resourcemanager.app.models.Dapr; +import com.azure.resourcemanager.app.models.Ingress; +import com.azure.resourcemanager.app.models.Scale; +import com.azure.resourcemanager.app.models.ScaleRule; +import com.azure.resourcemanager.app.models.Template; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps CreateOrUpdate. */ +public final class ContainerAppsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withManagedEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true).withTargetPort(3000))) + .withTemplate( + new Template() + .withContainers( + Arrays + .asList( + new Container().withImage("repo/testcontainerApp0:v1").withName("testcontainerApp0"))) + .withScale( + new Scale() + .withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays + .asList( + new ScaleRule() + .withName("httpscalingrule") + .withCustom( + new CustomScaleRule() + .withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} +``` + +### 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-01-01-preview/examples/ContainerApps_Delete.json + */ + /** + * Sample code: Delete Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().delete("rg", "testWorkerApp0", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/ContainerApps_Get.json + */ + /** + * Sample code: Get Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/ContainerApps_ListBySubscription.json + */ + /** + * Sample code: List Container Apps by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsBySubscription(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().list(Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/ContainerApps_ListByResourceGroup.json + */ + /** + * Sample code: List Container Apps by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsByResourceGroup(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().listByResourceGroup("rg", Context.NONE); + } +} +``` + +### ContainerApps_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.ContainerApp; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps Update. */ +public final class ContainerAppsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_Patch.json + */ + /** + * Sample code: Patch Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + ContainerApp resource = + manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", 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; + } +} +``` + +### 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-01-01-preview/examples/Replicas_Get.json + */ + /** + * Sample code: Get Container App's revision replica. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSRevisionReplica(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisionReplicas() + .getReplicaWithResponse( + "workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/Replicas_List.json + */ + /** + * Sample code: List Container App's replicas. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppSReplicas(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisionReplicas() + .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/Revisions_Activate.json + */ + /** + * Sample code: Activate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void activateContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/Revisions_Deactivate.json + */ + /** + * Sample code: Deactivate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deactivateContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/Revisions_Get.json + */ + /** + * Sample code: Get Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/Revisions_List.json + */ + /** + * Sample code: List Container App's revisions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppSRevisions(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsRevisions().listRevisions("rg", "testcontainerApp0", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/Revisions_Restart.json + */ + /** + * Sample code: Restart Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void restartContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} +``` + +### ContainerAppsSourceControls_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AzureCredentials; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.RegistryInfo; + +/** Samples for ContainerAppsSourceControls CreateOrUpdate. */ +public final class ContainerAppsSourceControlsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppSourceControl( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsSourceControls() + .define("current") + .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") + .withRepoUrl("https://github.com/xwang971/ghatest") + .withBranch("master") + .withGithubActionConfiguration( + new GithubActionConfiguration() + .withRegistryInfo( + new RegistryInfo() + .withRegistryUrl("xwang971reg.azurecr.io") + .withRegistryUsername("xwang971reg") + .withRegistryPassword("")) + .withAzureCredentials( + new AzureCredentials() + .withClientId("") + .withClientSecret("") + .withTenantId(""))) + .create(); + } +} +``` + +### 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-01-01-preview/examples/SourceControls_Delete.json + */ + /** + * Sample code: Delete Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerAppSourceControl(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls().delete("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/SourceControls_Get.json + */ + /** + * Sample code: Get Container App's SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSSourceControl(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsSourceControls() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/SourceControls_ListByContainer.json + */ + /** + * Sample code: List App's Source Controls. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAppSSourceControls(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + } +} +``` + +### ManagedEnvironments_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.LogAnalyticsConfiguration; + +/** Samples for ManagedEnvironments CreateOrUpdate. */ +public final class ManagedEnvironmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json + */ + /** + * Sample code: Create environments. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createEnvironments(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .managedEnvironments() + .define("testcontainerenv") + .withRegion("East US") + .withExistingResourceGroup("examplerg") + .withAppLogsConfiguration( + new AppLogsConfiguration() + .withLogAnalyticsConfiguration( + new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("string"))) + .create(); + } +} +``` + +### 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-01-01-preview/examples/ManagedEnvironments_Delete.json + */ + /** + * Sample code: Delete environment by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteEnvironmentByName(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().delete("examplerg", "examplekenv", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/ManagedEnvironments_Get.json + */ + /** + * Sample code: Get environments by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getEnvironmentsByName(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().getByResourceGroupWithResponse("examplerg", "jlaw-demo1", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/ManagedEnvironments_ListBySubscription.json + */ + /** + * Sample code: List environments by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsBySubscription(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().list(Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json + */ + /** + * Sample code: List environments by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsByResourceGroup(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().listByResourceGroup("examplerg", Context.NONE); + } +} +``` + +### ManagedEnvironments_Update + +```java +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.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-01-01-preview/examples/ManagedEnvironments_Patch.json + */ + /** + * Sample code: Patch Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchManagedEnvironment(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + ManagedEnvironment resource = + manager + .managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "testcontainerenv", 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; + } +} +``` + +### ManagedEnvironmentsStorages_CreateOrUpdate + +```java +import com.azure.resourcemanager.app.models.AccessMode; +import com.azure.resourcemanager.app.models.AzureFileProperties; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorageProperties; + +/** Samples for ManagedEnvironmentsStorages CreateOrUpdate. */ +public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json + */ + /** + * Sample code: Create or update environments storage. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateEnvironmentsStorage( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .managedEnvironmentsStorages() + .define("jlaw-demo1") + .withExistingManagedEnvironment("examplerg", "managedEnv") + .withProperties( + new ManagedEnvironmentStorageProperties() + .withAzureFile( + new AzureFileProperties() + .withAccountName("account1") + .withAccountKey("key") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) + .create(); + } +} +``` + +### 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-01-01-preview/examples/ManagedEnvironmentsStorages_Delete.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/ManagedEnvironmentsStorages_Get.json + */ + /** + * Sample code: get a environments storage properties by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAEnvironmentsStoragePropertiesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().getWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/ManagedEnvironmentsStorages_List.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", Context.NONE); + } +} +``` + +### 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-01-01-preview/examples/Operations_List.json + */ + /** + * Sample code: List all operations. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAllOperations(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.operations().list(Context.NONE); + } +} +``` + diff --git a/sdk/app/azure-resourcemanager-app/pom.xml b/sdk/app/azure-resourcemanager-app/pom.xml new file mode 100644 index 0000000000000..1c97418db5372 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/pom.xml @@ -0,0 +1,55 @@ + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure.resourcemanager + azure-resourcemanager-app + 1.0.0-beta.1 + 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-2022-01-01-preview. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + true + + + + com.azure + azure-core + 1.24.1 + + + com.azure + azure-core-management + 1.5.1 + + + diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/ContainerAppsApiManager.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/ContainerAppsApiManager.java new file mode 100644 index 0000000000000..bc3390fa2d5b1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/ContainerAppsApiManager.java @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app; + +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; +import com.azure.core.management.profile.AzureProfile; +import com.azure.core.util.Configuration; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ContainerAppsApiClient; +import com.azure.resourcemanager.app.implementation.ContainerAppsApiClientBuilder; +import com.azure.resourcemanager.app.implementation.ContainerAppsImpl; +import com.azure.resourcemanager.app.implementation.ContainerAppsRevisionReplicasImpl; +import com.azure.resourcemanager.app.implementation.ContainerAppsRevisionsImpl; +import com.azure.resourcemanager.app.implementation.ContainerAppsSourceControlsImpl; +import com.azure.resourcemanager.app.implementation.ManagedEnvironmentsImpl; +import com.azure.resourcemanager.app.implementation.ManagedEnvironmentsStoragesImpl; +import com.azure.resourcemanager.app.implementation.OperationsImpl; +import com.azure.resourcemanager.app.models.ContainerApps; +import com.azure.resourcemanager.app.models.ContainerAppsRevisionReplicas; +import com.azure.resourcemanager.app.models.ContainerAppsRevisions; +import com.azure.resourcemanager.app.models.ContainerAppsSourceControls; +import com.azure.resourcemanager.app.models.ManagedEnvironments; +import com.azure.resourcemanager.app.models.ManagedEnvironmentsStorages; +import com.azure.resourcemanager.app.models.Operations; +import java.time.Duration; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + +/** Entry point to ContainerAppsApiManager. */ +public final class ContainerAppsApiManager { + private ContainerApps containerApps; + + private ContainerAppsRevisions containerAppsRevisions; + + private ContainerAppsRevisionReplicas containerAppsRevisionReplicas; + + private ManagedEnvironments managedEnvironments; + + private Operations operations; + + private ContainerAppsSourceControls containerAppsSourceControls; + + private ManagedEnvironmentsStorages managedEnvironmentsStorages; + + private final ContainerAppsApiClient clientObject; + + private ContainerAppsApiManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { + Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + this.clientObject = + new ContainerAppsApiClientBuilder() + .pipeline(httpPipeline) + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); + } + + /** + * Creates an instance of ContainerAppsApi service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerAppsApi service API instance. + */ + public static ContainerAppsApiManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + return configure().authenticate(credential, profile); + } + + /** + * Gets a Configurable instance that can be used to create ContainerAppsApiManager with optional configuration. + * + * @return the Configurable instance allowing configurations. + */ + public static Configurable configure() { + return new ContainerAppsApiManager.Configurable(); + } + + /** The Configurable allowing configurations to be set. */ + public static final class Configurable { + private final ClientLogger logger = new ClientLogger(Configurable.class); + + private HttpClient httpClient; + private HttpLogOptions httpLogOptions; + private final List policies = new ArrayList<>(); + private final List scopes = new ArrayList<>(); + private RetryPolicy retryPolicy; + private Duration defaultPollInterval; + + private Configurable() { + } + + /** + * Sets the http client. + * + * @param httpClient the HTTP client. + * @return the configurable object itself. + */ + public Configurable withHttpClient(HttpClient httpClient) { + this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); + return this; + } + + /** + * Sets the logging options to the HTTP pipeline. + * + * @param httpLogOptions the HTTP log options. + * @return the configurable object itself. + */ + public Configurable withLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); + return this; + } + + /** + * Adds the pipeline policy to the HTTP pipeline. + * + * @param policy the HTTP pipeline policy. + * @return the configurable object itself. + */ + public Configurable withPolicy(HttpPipelinePolicy policy) { + this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); + return this; + } + + /** + * Adds the scope to permission sets. + * + * @param scope the scope. + * @return the configurable object itself. + */ + public Configurable withScope(String scope) { + this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); + return this; + } + + /** + * Sets the retry policy to the HTTP pipeline. + * + * @param retryPolicy the HTTP pipeline retry policy. + * @return the configurable object itself. + */ + public Configurable withRetryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); + return this; + } + + /** + * Sets the default poll interval, used when service does not provide "Retry-After" header. + * + * @param defaultPollInterval the default poll interval. + * @return the configurable object itself. + */ + public Configurable withDefaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null."); + if (this.defaultPollInterval.isNegative()) { + throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative")); + } + return this; + } + + /** + * Creates an instance of ContainerAppsApi service API entry point. + * + * @param credential the credential to use. + * @param profile the Azure profile for client. + * @return the ContainerAppsApi service API instance. + */ + public ContainerAppsApiManager authenticate(TokenCredential credential, AzureProfile profile) { + Objects.requireNonNull(credential, "'credential' cannot be null."); + Objects.requireNonNull(profile, "'profile' cannot be null."); + + StringBuilder userAgentBuilder = new StringBuilder(); + userAgentBuilder + .append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.app") + .append("/") + .append("1.0.0-beta.1"); + if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { + userAgentBuilder + .append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); + } else { + userAgentBuilder.append(" (auto-generated)"); + } + + if (scopes.isEmpty()) { + scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); + } + if (retryPolicy == null) { + retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); + } + List policies = new ArrayList<>(); + policies.add(new UserAgentPolicy(userAgentBuilder.toString())); + policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(retryPolicy); + policies.add(new AddDatePolicy()); + policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(httpLogOptions)); + HttpPipeline httpPipeline = + new HttpPipelineBuilder() + .httpClient(httpClient) + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); + return new ContainerAppsApiManager(httpPipeline, profile, defaultPollInterval); + } + } + + /** @return Resource collection API of ContainerApps. */ + public ContainerApps containerApps() { + if (this.containerApps == null) { + this.containerApps = new ContainerAppsImpl(clientObject.getContainerApps(), this); + } + return containerApps; + } + + /** @return Resource collection API of ContainerAppsRevisions. */ + public ContainerAppsRevisions containerAppsRevisions() { + if (this.containerAppsRevisions == null) { + this.containerAppsRevisions = + new ContainerAppsRevisionsImpl(clientObject.getContainerAppsRevisions(), this); + } + return containerAppsRevisions; + } + + /** @return Resource collection API of ContainerAppsRevisionReplicas. */ + public ContainerAppsRevisionReplicas containerAppsRevisionReplicas() { + if (this.containerAppsRevisionReplicas == null) { + this.containerAppsRevisionReplicas = + new ContainerAppsRevisionReplicasImpl(clientObject.getContainerAppsRevisionReplicas(), this); + } + return containerAppsRevisionReplicas; + } + + /** @return Resource collection API of ManagedEnvironments. */ + public ManagedEnvironments managedEnvironments() { + if (this.managedEnvironments == null) { + this.managedEnvironments = new ManagedEnvironmentsImpl(clientObject.getManagedEnvironments(), this); + } + return managedEnvironments; + } + + /** @return Resource collection API of Operations. */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); + } + return operations; + } + + /** @return Resource collection API of ContainerAppsSourceControls. */ + public ContainerAppsSourceControls containerAppsSourceControls() { + if (this.containerAppsSourceControls == null) { + this.containerAppsSourceControls = + new ContainerAppsSourceControlsImpl(clientObject.getContainerAppsSourceControls(), this); + } + return containerAppsSourceControls; + } + + /** @return Resource collection API of ManagedEnvironmentsStorages. */ + public ManagedEnvironmentsStorages managedEnvironmentsStorages() { + if (this.managedEnvironmentsStorages == null) { + this.managedEnvironmentsStorages = + new ManagedEnvironmentsStoragesImpl(clientObject.getManagedEnvironmentsStorages(), this); + } + return managedEnvironmentsStorages; + } + + /** + * @return Wrapped service client ContainerAppsApiClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. + */ + public ContainerAppsApiClient serviceClient() { + return this.clientObject; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsApiClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsApiClient.java new file mode 100644 index 0000000000000..f51c8c412af65 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsApiClient.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent; + +import com.azure.core.http.HttpPipeline; +import java.time.Duration; + +/** The interface for ContainerAppsApiClient class. */ +public interface ContainerAppsApiClient { + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + String getEndpoint(); + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + HttpPipeline getHttpPipeline(); + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + Duration getDefaultPollInterval(); + + /** + * Gets the ContainerAppsClient object to access its operations. + * + * @return the ContainerAppsClient object. + */ + ContainerAppsClient getContainerApps(); + + /** + * Gets the ContainerAppsRevisionsClient object to access its operations. + * + * @return the ContainerAppsRevisionsClient object. + */ + ContainerAppsRevisionsClient getContainerAppsRevisions(); + + /** + * Gets the ContainerAppsRevisionReplicasClient object to access its operations. + * + * @return the ContainerAppsRevisionReplicasClient object. + */ + ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas(); + + /** + * Gets the ManagedEnvironmentsClient object to access its operations. + * + * @return the ManagedEnvironmentsClient object. + */ + ManagedEnvironmentsClient getManagedEnvironments(); + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + + /** + * Gets the ContainerAppsSourceControlsClient object to access its operations. + * + * @return the ContainerAppsSourceControlsClient object. + */ + ContainerAppsSourceControlsClient getContainerAppsSourceControls(); + + /** + * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * + * @return the ManagedEnvironmentsStoragesClient object. + */ + ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsClient.java new file mode 100644 index 0000000000000..1ac4f437f649f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsClient.java @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.ContainerAppInner; +import com.azure.resourcemanager.app.models.ContainerAppPatch; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainerAppsClient. */ +public interface ContainerAppsClient { + /** + * Get the Container Apps in a given subscription. + * + * @throws com.azure.resourcemanager.app.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 in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get the Container Apps 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.app.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 in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get the Container Apps 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.app.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 in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the Container Apps 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.app.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 in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ContainerAppInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppInner> beginCreateOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope); + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ContainerAppInner> beginCreateOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context); + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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) + ContainerAppInner createOrUpdate(String resourceGroupName, String name, ContainerAppInner containerAppEnvelope); + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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) + ContainerAppInner createOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 name); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.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 name, Context context); + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.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) + ContainerAppInner update(String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope); + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionReplicasClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionReplicasClient.java new file mode 100644 index 0000000000000..8e8efcff0ad66 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionReplicasClient.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.app.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; + +/** An instance of this class provides access to all the operations defined in ContainerAppsRevisionReplicasClient. */ +public interface ContainerAppsRevisionReplicasClient { + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 replica for a Container App Revision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicaInner getReplica(String resourceGroupName, String containerAppName, String revisionName, String name); + + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 replica for a Container App Revision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getReplicaWithResponse( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context); + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Revision Replicas collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ReplicaCollectionInner listReplicas(String resourceGroupName, String containerAppName, String revisionName); + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Revision Replicas collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listReplicasWithResponse( + String resourceGroupName, String containerAppName, String revisionName, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionsClient.java new file mode 100644 index 0000000000000..509a8f3721750 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsRevisionsClient.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; + +/** An instance of this class provides access to all the operations defined in ContainerAppsRevisionsClient. */ +public interface ContainerAppsRevisionsClient { + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Revisions for a given Container App. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String resourceGroupName, String containerAppName); + + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Revisions for a given Container App. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listRevisions(String resourceGroupName, String containerAppName, Context context); + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 revision of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RevisionInner getRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 revision of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 activateRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 activateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 deactivateRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 deactivateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 restartRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 restartRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsSourceControlsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsSourceControlsClient.java new file mode 100644 index 0000000000000..bab38a50db8dc --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ContainerAppsSourceControlsClient.java @@ -0,0 +1,219 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.SourceControlInner; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainerAppsSourceControlsClient. */ +public interface ContainerAppsSourceControlsClient { + /** + * Get the Container App SourceControls in a given resource group. + * + * @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.resourcemanager.app.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 App SourceControls in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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.resourcemanager.app.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 App SourceControls in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByContainerApp( + String resourceGroupName, String containerAppName, Context context); + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlInner get(String resourceGroupName, String containerAppName, String name); + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SourceControlInner> beginCreateOrUpdate( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope); + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SourceControlInner> beginCreateOrUpdate( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context); + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlInner createOrUpdate( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope); + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceControlInner createOrUpdate( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context); + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String containerAppName, String name); + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 containerAppName, String name); + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 containerAppName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsClient.java new file mode 100644 index 0000000000000..cbfa642ea8216 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsClient.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.app.models.ManagedEnvironmentPatch; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedEnvironmentsClient. */ +public interface ManagedEnvironmentsClient { + /** + * Get all Managed Environments for a subscription. + * + * @throws com.azure.resourcemanager.app.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 Managed Environments for a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Get all Managed Environments for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environments for a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Get all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 the Managed Environments in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 the Managed Environments in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environment used to host container apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentInner getByResourceGroup(String resourceGroupName, String name); + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environment used to host container apps along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context); + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope); + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context); + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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) + ManagedEnvironmentInner createOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope); + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.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) + ManagedEnvironmentInner createOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context); + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name); + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context); + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 name); + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 name, Context context); + + /** + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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) + ManagedEnvironmentInner update(String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope); + + /** + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.app.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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsStoragesClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsStoragesClient.java new file mode 100644 index 0000000000000..204a22816a1e2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/ManagedEnvironmentsStoragesClient.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; + +/** An instance of this class provides access to all the operations defined in ManagedEnvironmentsStoragesClient. */ +public interface ManagedEnvironmentsStoragesClient { + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 collection of Storage for Environments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentStoragesCollectionInner list(String resourceGroupName, String envName); + + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 collection of Storage for Environments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response listWithResponse( + String resourceGroupName, String envName, Context context); + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage for a managedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentStorageInner get(String resourceGroupName, String envName, String name); + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage for a managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse( + String resourceGroupName, String envName, String name, Context context); + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage resource for managedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ManagedEnvironmentStorageInner createOrUpdate( + String resourceGroupName, String envName, String name, ManagedEnvironmentStorageInner storageEnvelope); + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage resource for managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createOrUpdateWithResponse( + String resourceGroupName, + String envName, + String name, + ManagedEnvironmentStorageInner storageEnvelope, + Context context); + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 envName, String name); + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 envName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/OperationsClient.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/OperationsClient.java new file mode 100644 index 0000000000000..334fd3a9a7bb8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/OperationsClient.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.models.OperationDetailInner; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public interface OperationsClient { + /** + * Lists all of the available RP operations. + * + * @throws com.azure.resourcemanager.app.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 available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all of the available RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppInner.java new file mode 100644 index 0000000000000..cee0dd23bbea1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.ContainerAppProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Container App. */ +@Fluent +public final class ContainerAppInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppInner.class); + + /* + * ContainerApp resource specific properties + */ + @JsonProperty(value = "properties") + private ContainerAppProperties innerProperties; + + /** + * Get the innerProperties property: ContainerApp resource specific properties. + * + * @return the innerProperties value. + */ + private ContainerAppProperties innerProperties() { + return this.innerProperties; + } + + /** {@inheritDoc} */ + @Override + public ContainerAppInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ContainerAppInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Container App. + * + * @return the provisioningState value. + */ + public ContainerAppProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @return the managedEnvironmentId value. + */ + public String managedEnvironmentId() { + return this.innerProperties() == null ? null : this.innerProperties().managedEnvironmentId(); + } + + /** + * Set the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @param managedEnvironmentId the managedEnvironmentId value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withManagedEnvironmentId(String managedEnvironmentId) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerAppProperties(); + } + this.innerProperties().withManagedEnvironmentId(managedEnvironmentId); + return this; + } + + /** + * Get the latestRevisionName property: Name of the latest revision of the Container App. + * + * @return the latestRevisionName value. + */ + public String latestRevisionName() { + return this.innerProperties() == null ? null : this.innerProperties().latestRevisionName(); + } + + /** + * Get the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. + * + * @return the latestRevisionFqdn value. + */ + public String latestRevisionFqdn() { + return this.innerProperties() == null ? null : this.innerProperties().latestRevisionFqdn(); + } + + /** + * Get the configuration property: Non versioned Container App configuration properties. + * + * @return the configuration value. + */ + public Configuration configuration() { + return this.innerProperties() == null ? null : this.innerProperties().configuration(); + } + + /** + * Set the configuration property: Non versioned Container App configuration properties. + * + * @param configuration the configuration value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withConfiguration(Configuration configuration) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerAppProperties(); + } + this.innerProperties().withConfiguration(configuration); + return this; + } + + /** + * Get the template property: Container App versioned application definition. + * + * @return the template value. + */ + public Template template() { + return this.innerProperties() == null ? null : this.innerProperties().template(); + } + + /** + * Set the template property: Container App versioned application definition. + * + * @param template the template value to set. + * @return the ContainerAppInner object itself. + */ + public ContainerAppInner withTemplate(Template template) { + if (this.innerProperties() == null) { + this.innerProperties = new ContainerAppProperties(); + } + this.innerProperties().withTemplate(template); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppProperties.java new file mode 100644 index 0000000000000..ff063a68344b6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ContainerAppProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.ContainerAppProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** ContainerApp resource specific properties. */ +@Fluent +public final class ContainerAppProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppProperties.class); + + /* + * Provisioning state of the Container App. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ContainerAppProvisioningState provisioningState; + + /* + * Resource ID of the Container App's environment. + */ + @JsonProperty(value = "managedEnvironmentId") + private String managedEnvironmentId; + + /* + * Name of the latest revision of the Container App. + */ + @JsonProperty(value = "latestRevisionName", access = JsonProperty.Access.WRITE_ONLY) + private String latestRevisionName; + + /* + * Fully Qualified Domain Name of the latest revision of the Container App. + */ + @JsonProperty(value = "latestRevisionFqdn", access = JsonProperty.Access.WRITE_ONLY) + private String latestRevisionFqdn; + + /* + * Non versioned Container App configuration properties. + */ + @JsonProperty(value = "configuration") + private Configuration configuration; + + /* + * Container App versioned application definition. + */ + @JsonProperty(value = "template") + private Template template; + + /** + * Get the provisioningState property: Provisioning state of the Container App. + * + * @return the provisioningState value. + */ + public ContainerAppProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @return the managedEnvironmentId value. + */ + public String managedEnvironmentId() { + return this.managedEnvironmentId; + } + + /** + * Set the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @param managedEnvironmentId the managedEnvironmentId value to set. + * @return the ContainerAppProperties object itself. + */ + public ContainerAppProperties withManagedEnvironmentId(String managedEnvironmentId) { + this.managedEnvironmentId = managedEnvironmentId; + return this; + } + + /** + * Get the latestRevisionName property: Name of the latest revision of the Container App. + * + * @return the latestRevisionName value. + */ + public String latestRevisionName() { + return this.latestRevisionName; + } + + /** + * Get the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. + * + * @return the latestRevisionFqdn value. + */ + public String latestRevisionFqdn() { + return this.latestRevisionFqdn; + } + + /** + * Get the configuration property: Non versioned Container App configuration properties. + * + * @return the configuration value. + */ + public Configuration configuration() { + return this.configuration; + } + + /** + * Set the configuration property: Non versioned Container App configuration properties. + * + * @param configuration the configuration value to set. + * @return the ContainerAppProperties object itself. + */ + public ContainerAppProperties withConfiguration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /** + * Get the template property: Container App versioned application definition. + * + * @return the template value. + */ + public Template template() { + return this.template; + } + + /** + * Set the template property: Container App versioned application definition. + * + * @param template the template value to set. + * @return the ContainerAppProperties object itself. + */ + public ContainerAppProperties withTemplate(Template template) { + this.template = template; + 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/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentInner.java new file mode 100644 index 0000000000000..8d779cf649b03 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentInner.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.EnvironmentProvisioningState; +import com.azure.resourcemanager.app.models.VnetConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An environment for hosting container apps. */ +@Fluent +public final class ManagedEnvironmentInner extends Resource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentInner.class); + + /* + * Environment resource specific properties + */ + @JsonProperty(value = "properties") + private ManagedEnvironmentProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Environment resource specific properties. + * + * @return the innerProperties value. + */ + private ManagedEnvironmentProperties 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 ManagedEnvironmentInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** {@inheritDoc} */ + @Override + public ManagedEnvironmentInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the Environment. + * + * @return the provisioningState value. + */ + public EnvironmentProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @return the daprAIInstrumentationKey value. + */ + public String daprAIInstrumentationKey() { + return this.innerProperties() == null ? null : this.innerProperties().daprAIInstrumentationKey(); + } + + /** + * Set the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @param daprAIInstrumentationKey the daprAIInstrumentationKey value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withDaprAIInstrumentationKey(String daprAIInstrumentationKey) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withDaprAIInstrumentationKey(daprAIInstrumentationKey); + return this; + } + + /** + * Get the vnetConfiguration property: Vnet configuration for the environment. + * + * @return the vnetConfiguration value. + */ + public VnetConfiguration vnetConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().vnetConfiguration(); + } + + /** + * Set the vnetConfiguration property: Vnet configuration for the environment. + * + * @param vnetConfiguration the vnetConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withVnetConfiguration(VnetConfiguration vnetConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withVnetConfiguration(vnetConfiguration); + return this; + } + + /** + * Get the deploymentErrors property: Any errors that occurred during deployment or deployment validation. + * + * @return the deploymentErrors value. + */ + public String deploymentErrors() { + return this.innerProperties() == null ? null : this.innerProperties().deploymentErrors(); + } + + /** + * Get the internalLoadBalancerEnabled property: Only visible within Vnet/Subnet. + * + * @return the internalLoadBalancerEnabled value. + */ + public Boolean internalLoadBalancerEnabled() { + return this.innerProperties() == null ? null : this.innerProperties().internalLoadBalancerEnabled(); + } + + /** + * Set the internalLoadBalancerEnabled property: Only visible within Vnet/Subnet. + * + * @param internalLoadBalancerEnabled the internalLoadBalancerEnabled value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withInternalLoadBalancerEnabled(Boolean internalLoadBalancerEnabled) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withInternalLoadBalancerEnabled(internalLoadBalancerEnabled); + return this; + } + + /** + * Get the defaultDomain property: Default Domain Name for the cluster. + * + * @return the defaultDomain value. + */ + public String defaultDomain() { + return this.innerProperties() == null ? null : this.innerProperties().defaultDomain(); + } + + /** + * Get the staticIp property: Static IP of the Environment. + * + * @return the staticIp value. + */ + public String staticIp() { + return this.innerProperties() == null ? null : this.innerProperties().staticIp(); + } + + /** + * Get the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * + * @return the appLogsConfiguration value. + */ + public AppLogsConfiguration appLogsConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().appLogsConfiguration(); + } + + /** + * Set the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * + * @param appLogsConfiguration the appLogsConfiguration value to set. + * @return the ManagedEnvironmentInner object itself. + */ + public ManagedEnvironmentInner withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new ManagedEnvironmentProperties(); + } + this.innerProperties().withAppLogsConfiguration(appLogsConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentProperties.java new file mode 100644 index 0000000000000..f6f6cefaf2dbf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentProperties.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.EnvironmentProvisioningState; +import com.azure.resourcemanager.app.models.VnetConfiguration; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Environment resource specific properties. */ +@Fluent +public final class ManagedEnvironmentProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentProperties.class); + + /* + * Provisioning state of the Environment. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private EnvironmentProvisioningState provisioningState; + + /* + * Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry + */ + @JsonProperty(value = "daprAIInstrumentationKey") + private String daprAIInstrumentationKey; + + /* + * Vnet configuration for the environment + */ + @JsonProperty(value = "vnetConfiguration") + private VnetConfiguration vnetConfiguration; + + /* + * Any errors that occurred during deployment or deployment validation + */ + @JsonProperty(value = "deploymentErrors", access = JsonProperty.Access.WRITE_ONLY) + private String deploymentErrors; + + /* + * Only visible within Vnet/Subnet + */ + @JsonProperty(value = "internalLoadBalancerEnabled") + private Boolean internalLoadBalancerEnabled; + + /* + * Default Domain Name for the cluster + */ + @JsonProperty(value = "defaultDomain", access = JsonProperty.Access.WRITE_ONLY) + private String defaultDomain; + + /* + * Static IP of the Environment + */ + @JsonProperty(value = "staticIp", access = JsonProperty.Access.WRITE_ONLY) + private String staticIp; + + /* + * Cluster configuration which enables the log daemon to export + * app logs to a destination. Currently only "log-analytics" is + * supported + */ + @JsonProperty(value = "appLogsConfiguration") + private AppLogsConfiguration appLogsConfiguration; + + /** + * Get the provisioningState property: Provisioning state of the Environment. + * + * @return the provisioningState value. + */ + public EnvironmentProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @return the daprAIInstrumentationKey value. + */ + public String daprAIInstrumentationKey() { + return this.daprAIInstrumentationKey; + } + + /** + * Set the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @param daprAIInstrumentationKey the daprAIInstrumentationKey value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withDaprAIInstrumentationKey(String daprAIInstrumentationKey) { + this.daprAIInstrumentationKey = daprAIInstrumentationKey; + return this; + } + + /** + * Get the vnetConfiguration property: Vnet configuration for the environment. + * + * @return the vnetConfiguration value. + */ + public VnetConfiguration vnetConfiguration() { + return this.vnetConfiguration; + } + + /** + * Set the vnetConfiguration property: Vnet configuration for the environment. + * + * @param vnetConfiguration the vnetConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withVnetConfiguration(VnetConfiguration vnetConfiguration) { + this.vnetConfiguration = vnetConfiguration; + return this; + } + + /** + * Get the deploymentErrors property: Any errors that occurred during deployment or deployment validation. + * + * @return the deploymentErrors value. + */ + public String deploymentErrors() { + return this.deploymentErrors; + } + + /** + * Get the internalLoadBalancerEnabled property: Only visible within Vnet/Subnet. + * + * @return the internalLoadBalancerEnabled value. + */ + public Boolean internalLoadBalancerEnabled() { + return this.internalLoadBalancerEnabled; + } + + /** + * Set the internalLoadBalancerEnabled property: Only visible within Vnet/Subnet. + * + * @param internalLoadBalancerEnabled the internalLoadBalancerEnabled value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withInternalLoadBalancerEnabled(Boolean internalLoadBalancerEnabled) { + this.internalLoadBalancerEnabled = internalLoadBalancerEnabled; + return this; + } + + /** + * Get the defaultDomain property: Default Domain Name for the cluster. + * + * @return the defaultDomain value. + */ + public String defaultDomain() { + return this.defaultDomain; + } + + /** + * Get the staticIp property: Static IP of the Environment. + * + * @return the staticIp value. + */ + public String staticIp() { + return this.staticIp; + } + + /** + * Get the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * + * @return the appLogsConfiguration value. + */ + public AppLogsConfiguration appLogsConfiguration() { + return this.appLogsConfiguration; + } + + /** + * Set the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * + * @param appLogsConfiguration the appLogsConfiguration value to set. + * @return the ManagedEnvironmentProperties object itself. + */ + public ManagedEnvironmentProperties withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration) { + this.appLogsConfiguration = appLogsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (vnetConfiguration() != null) { + vnetConfiguration().validate(); + } + if (appLogsConfiguration() != null) { + appLogsConfiguration().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStorageInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStorageInner.java new file mode 100644 index 0000000000000..f7cc683fe121c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStorageInner.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorageProperties; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage resource for managedEnvironment. */ +@Fluent +public final class ManagedEnvironmentStorageInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentStorageInner.class); + + /* + * Storage properties + */ + @JsonProperty(value = "properties") + private ManagedEnvironmentStorageProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the properties property: Storage properties. + * + * @return the properties value. + */ + public ManagedEnvironmentStorageProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Storage properties. + * + * @param properties the properties value to set. + * @return the ManagedEnvironmentStorageInner object itself. + */ + public ManagedEnvironmentStorageInner withProperties(ManagedEnvironmentStorageProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStoragesCollectionInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStoragesCollectionInner.java new file mode 100644 index 0000000000000..7e52342032ba9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ManagedEnvironmentStoragesCollectionInner.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.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Storage for Environments. */ +@Fluent +public final class ManagedEnvironmentStoragesCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentStoragesCollectionInner.class); + + /* + * Collection of storage resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * Get the value property: Collection of storage resources. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of storage resources. + * + * @param value the value value to set. + * @return the ManagedEnvironmentStoragesCollectionInner object itself. + */ + public ManagedEnvironmentStoragesCollectionInner 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 ManagedEnvironmentStoragesCollectionInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/OperationDetailInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/OperationDetailInner.java new file mode 100644 index 0000000000000..528834c8d3f28 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/OperationDetailInner.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.OperationDisplay; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation detail payload. */ +@Fluent +public final class OperationDetailInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDetailInner.class); + + /* + * Name of the operation + */ + @JsonProperty(value = "name") + private String name; + + /* + * Indicates whether the operation is a data action + */ + @JsonProperty(value = "isDataAction") + private Boolean isDataAction; + + /* + * Display of the operation + */ + @JsonProperty(value = "display") + private OperationDisplay display; + + /* + * Origin of the operation + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Get the name property: Name of the operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the operation. + * + * @param name the name value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: Display of the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: Display of the operation. + * + * @param display the display value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Get the origin property: Origin of the operation. + * + * @return the origin value. + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin property: Origin of the operation. + * + * @param origin the origin value to set. + * @return the OperationDetailInner object itself. + */ + public OperationDetailInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaCollectionInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaCollectionInner.java new file mode 100644 index 0000000000000..d4efb016525e7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaCollectionInner.java @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Revision Replicas collection ARM resource. */ +@Fluent +public final class ReplicaCollectionInner { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicaCollectionInner.class); + + /* + * Collection of resources. + */ + @JsonProperty(value = "value", required = true) + private List value; + + /** + * 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 ReplicaCollectionInner object itself. + */ + public ReplicaCollectionInner 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 ReplicaCollectionInner")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaInner.java new file mode 100644 index 0000000000000..4c00b134ad355 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaInner.java @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.ReplicaContainer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Container App Revision Replica. */ +@Fluent +public final class ReplicaInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicaInner.class); + + /* + * Replica resource specific properties + */ + @JsonProperty(value = "properties") + private ReplicaProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: Replica resource specific properties. + * + * @return the innerProperties value. + */ + private ReplicaProperties 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; + } + + /** + * Get the createdTime property: Timestamp describing when the pod was created by controller. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.innerProperties() == null ? null : this.innerProperties().createdTime(); + } + + /** + * Get the containers property: The containers collection under a replica. + * + * @return the containers value. + */ + public List containers() { + return this.innerProperties() == null ? null : this.innerProperties().containers(); + } + + /** + * Set the containers property: The containers collection under a replica. + * + * @param containers the containers value to set. + * @return the ReplicaInner object itself. + */ + public ReplicaInner withContainers(List containers) { + if (this.innerProperties() == null) { + this.innerProperties = new ReplicaProperties(); + } + this.innerProperties().withContainers(containers); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaProperties.java new file mode 100644 index 0000000000000..f7476a9d559c3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/ReplicaProperties.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.ReplicaContainer; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; +import java.util.List; + +/** Replica resource specific properties. */ +@Fluent +public final class ReplicaProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicaProperties.class); + + /* + * Timestamp describing when the pod was created by controller + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * The containers collection under a replica. + */ + @JsonProperty(value = "containers") + private List containers; + + /** + * Get the createdTime property: Timestamp describing when the pod was created by controller. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the containers property: The containers collection under a replica. + * + * @return the containers value. + */ + public List containers() { + return this.containers; + } + + /** + * Set the containers property: The containers collection under a replica. + * + * @param containers the containers value to set. + * @return the ReplicaProperties object itself. + */ + public ReplicaProperties withContainers(List containers) { + this.containers = containers; + 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()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionInner.java new file mode 100644 index 0000000000000..1f7e0496c048a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionInner.java @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.RevisionHealthState; +import com.azure.resourcemanager.app.models.RevisionProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Container App Revision. */ +@Fluent +public final class RevisionInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RevisionInner.class); + + /* + * Revision resource specific properties + */ + @JsonProperty(value = "properties") + private RevisionProperties innerProperties; + + /** + * Get the innerProperties property: Revision resource specific properties. + * + * @return the innerProperties value. + */ + private RevisionProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the createdTime property: Timestamp describing when the revision was created by controller. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.innerProperties() == null ? null : this.innerProperties().createdTime(); + } + + /** + * Get the fqdn property: Fully qualified domain name of the revision. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.innerProperties() == null ? null : this.innerProperties().fqdn(); + } + + /** + * Get the template property: Container App Revision Template with all possible settings and the defaults if user + * did not provide them. The defaults are populated as they were at the creation time. + * + * @return the template value. + */ + public Template template() { + return this.innerProperties() == null ? null : this.innerProperties().template(); + } + + /** + * Get the active property: Boolean describing if the Revision is Active. + * + * @return the active value. + */ + public Boolean active() { + return this.innerProperties() == null ? null : this.innerProperties().active(); + } + + /** + * Get the replicas property: Number of pods currently running for this revision. + * + * @return the replicas value. + */ + public Integer replicas() { + return this.innerProperties() == null ? null : this.innerProperties().replicas(); + } + + /** + * Get the trafficWeight property: Traffic weight assigned to this revision. + * + * @return the trafficWeight value. + */ + public Integer trafficWeight() { + return this.innerProperties() == null ? null : this.innerProperties().trafficWeight(); + } + + /** + * Get the provisioningError property: Optional Field - Platform Error Message. + * + * @return the provisioningError value. + */ + public String provisioningError() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningError(); + } + + /** + * Get the healthState property: Current health State of the revision. + * + * @return the healthState value. + */ + public RevisionHealthState healthState() { + return this.innerProperties() == null ? null : this.innerProperties().healthState(); + } + + /** + * Get the provisioningState property: Current provisioning State of the revision. + * + * @return the provisioningState value. + */ + public RevisionProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionProperties.java new file mode 100644 index 0000000000000..4104d599a8135 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/RevisionProperties.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.RevisionHealthState; +import com.azure.resourcemanager.app.models.RevisionProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.time.OffsetDateTime; + +/** Revision resource specific properties. */ +@Immutable +public final class RevisionProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RevisionProperties.class); + + /* + * Timestamp describing when the revision was created + * by controller + */ + @JsonProperty(value = "createdTime", access = JsonProperty.Access.WRITE_ONLY) + private OffsetDateTime createdTime; + + /* + * Fully qualified domain name of the revision + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated + * as they were at the creation time + */ + @JsonProperty(value = "template", access = JsonProperty.Access.WRITE_ONLY) + private Template template; + + /* + * Boolean describing if the Revision is Active + */ + @JsonProperty(value = "active", access = JsonProperty.Access.WRITE_ONLY) + private Boolean active; + + /* + * Number of pods currently running for this revision + */ + @JsonProperty(value = "replicas", access = JsonProperty.Access.WRITE_ONLY) + private Integer replicas; + + /* + * Traffic weight assigned to this revision + */ + @JsonProperty(value = "trafficWeight", access = JsonProperty.Access.WRITE_ONLY) + private Integer trafficWeight; + + /* + * Optional Field - Platform Error Message + */ + @JsonProperty(value = "provisioningError", access = JsonProperty.Access.WRITE_ONLY) + private String provisioningError; + + /* + * Current health State of the revision + */ + @JsonProperty(value = "healthState", access = JsonProperty.Access.WRITE_ONLY) + private RevisionHealthState healthState; + + /* + * Current provisioning State of the revision + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private RevisionProvisioningState provisioningState; + + /** + * Get the createdTime property: Timestamp describing when the revision was created by controller. + * + * @return the createdTime value. + */ + public OffsetDateTime createdTime() { + return this.createdTime; + } + + /** + * Get the fqdn property: Fully qualified domain name of the revision. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the template property: Container App Revision Template with all possible settings and the defaults if user + * did not provide them. The defaults are populated as they were at the creation time. + * + * @return the template value. + */ + public Template template() { + return this.template; + } + + /** + * Get the active property: Boolean describing if the Revision is Active. + * + * @return the active value. + */ + public Boolean active() { + return this.active; + } + + /** + * Get the replicas property: Number of pods currently running for this revision. + * + * @return the replicas value. + */ + public Integer replicas() { + return this.replicas; + } + + /** + * Get the trafficWeight property: Traffic weight assigned to this revision. + * + * @return the trafficWeight value. + */ + public Integer trafficWeight() { + return this.trafficWeight; + } + + /** + * Get the provisioningError property: Optional Field - Platform Error Message. + * + * @return the provisioningError value. + */ + public String provisioningError() { + return this.provisioningError; + } + + /** + * Get the healthState property: Current health State of the revision. + * + * @return the healthState value. + */ + public RevisionHealthState healthState() { + return this.healthState; + } + + /** + * Get the provisioningState property: Current provisioning State of the revision. + * + * @return the provisioningState value. + */ + public RevisionProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (template() != null) { + template().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlInner.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlInner.java new file mode 100644 index 0000000000000..ad260d3b45003 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlInner.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.SourceControlOperationState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App SourceControl. */ +@Fluent +public final class SourceControlInner extends ProxyResource { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlInner.class); + + /* + * SourceControl resource specific properties + */ + @JsonProperty(value = "properties") + private SourceControlProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy + * information. + */ + @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) + private SystemData systemData; + + /** + * Get the innerProperties property: SourceControl resource specific properties. + * + * @return the innerProperties value. + */ + private SourceControlProperties 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; + } + + /** + * Get the operationState property: Current provisioning State of the operation. + * + * @return the operationState value. + */ + public SourceControlOperationState operationState() { + return this.innerProperties() == null ? null : this.innerProperties().operationState(); + } + + /** + * Get the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @return the repoUrl value. + */ + public String repoUrl() { + return this.innerProperties() == null ? null : this.innerProperties().repoUrl(); + } + + /** + * Set the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @param repoUrl the repoUrl value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withRepoUrl(String repoUrl) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withRepoUrl(repoUrl); + return this; + } + + /** + * Get the branch property: The branch which will trigger the auto deployment. + * + * @return the branch value. + */ + public String branch() { + return this.innerProperties() == null ? null : this.innerProperties().branch(); + } + + /** + * Set the branch property: The branch which will trigger the auto deployment. + * + * @param branch the branch value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withBranch(String branch) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withBranch(branch); + return this; + } + + /** + * Get the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @return the githubActionConfiguration value. + */ + public GithubActionConfiguration githubActionConfiguration() { + return this.innerProperties() == null ? null : this.innerProperties().githubActionConfiguration(); + } + + /** + * Set the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @param githubActionConfiguration the githubActionConfiguration value to set. + * @return the SourceControlInner object itself. + */ + public SourceControlInner withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration) { + if (this.innerProperties() == null) { + this.innerProperties = new SourceControlProperties(); + } + this.innerProperties().withGithubActionConfiguration(githubActionConfiguration); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlProperties.java new file mode 100644 index 0000000000000..1a31ce880c1b4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/SourceControlProperties.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.SourceControlOperationState; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** SourceControl resource specific properties. */ +@Fluent +public final class SourceControlProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlProperties.class); + + /* + * Current provisioning State of the operation + */ + @JsonProperty(value = "operationState", access = JsonProperty.Access.WRITE_ONLY) + private SourceControlOperationState operationState; + + /* + * The repo url which will be integrated to ContainerApp. + */ + @JsonProperty(value = "repoUrl") + private String repoUrl; + + /* + * The branch which will trigger the auto deployment + */ + @JsonProperty(value = "branch") + private String branch; + + /* + * Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated + * as they were at the creation time + */ + @JsonProperty(value = "githubActionConfiguration") + private GithubActionConfiguration githubActionConfiguration; + + /** + * Get the operationState property: Current provisioning State of the operation. + * + * @return the operationState value. + */ + public SourceControlOperationState operationState() { + return this.operationState; + } + + /** + * Get the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @return the repoUrl value. + */ + public String repoUrl() { + return this.repoUrl; + } + + /** + * Set the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @param repoUrl the repoUrl value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withRepoUrl(String repoUrl) { + this.repoUrl = repoUrl; + return this; + } + + /** + * Get the branch property: The branch which will trigger the auto deployment. + * + * @return the branch value. + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch property: The branch which will trigger the auto deployment. + * + * @param branch the branch value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @return the githubActionConfiguration value. + */ + public GithubActionConfiguration githubActionConfiguration() { + return this.githubActionConfiguration; + } + + /** + * Set the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @param githubActionConfiguration the githubActionConfiguration value to set. + * @return the SourceControlProperties object itself. + */ + public SourceControlProperties withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration) { + this.githubActionConfiguration = githubActionConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (githubActionConfiguration() != null) { + githubActionConfiguration().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/package-info.java new file mode 100644 index 0000000000000..1d8bdaca7da83 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the inner data models for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app.fluent.models; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/package-info.java new file mode 100644 index 0000000000000..4cc51edd8bae0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/fluent/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the service clients for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app.fluent; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java new file mode 100644 index 0000000000000..a04cd1af3ff55 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppImpl.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.ContainerApp; +import com.azure.resourcemanager.app.models.ContainerAppPatch; +import com.azure.resourcemanager.app.models.ContainerAppProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import java.util.Collections; +import java.util.Map; + +public final class ContainerAppImpl implements ContainerApp, ContainerApp.Definition, ContainerApp.Update { + private ContainerAppInner innerObject; + + private final com.azure.resourcemanager.app.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 ContainerAppProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String managedEnvironmentId() { + return this.innerModel().managedEnvironmentId(); + } + + public String latestRevisionName() { + return this.innerModel().latestRevisionName(); + } + + public String latestRevisionFqdn() { + return this.innerModel().latestRevisionFqdn(); + } + + public Configuration configuration() { + return this.innerModel().configuration(); + } + + public Template template() { + return this.innerModel().template(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ContainerAppInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ContainerAppPatch updateContainerAppEnvelope; + + public ContainerAppImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ContainerApp create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ContainerApp create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ContainerAppImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new ContainerAppInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ContainerAppImpl update() { + this.updateContainerAppEnvelope = new ContainerAppPatch(); + return this; + } + + public ContainerApp apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .updateWithResponse(resourceGroupName, name, updateContainerAppEnvelope, Context.NONE) + .getValue(); + return this; + } + + public ContainerApp apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .updateWithResponse(resourceGroupName, name, updateContainerAppEnvelope, context) + .getValue(); + return this; + } + + ContainerAppImpl( + ContainerAppInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "containerApps"); + } + + public ContainerApp refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ContainerApp refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerApps() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ContainerAppImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ContainerAppImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ContainerAppImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateContainerAppEnvelope.withTags(tags); + return this; + } + } + + public ContainerAppImpl withManagedEnvironmentId(String managedEnvironmentId) { + this.innerModel().withManagedEnvironmentId(managedEnvironmentId); + return this; + } + + public ContainerAppImpl withConfiguration(Configuration configuration) { + this.innerModel().withConfiguration(configuration); + return this; + } + + public ContainerAppImpl withTemplate(Template template) { + this.innerModel().withTemplate(template); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientBuilder.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientBuilder.java new file mode 100644 index 0000000000000..a4a09a0a24dc7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientBuilder.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.CookiePolicy; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** A builder for creating a new instance of the ContainerAppsApiClientImpl type. */ +@ServiceClientBuilder(serviceClients = {ContainerAppsApiClientImpl.class}) +public final class ContainerAppsApiClientBuilder { + /* + * The ID of the target subscription. + */ + private String subscriptionId; + + /** + * Sets The ID of the target subscription. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerAppsApiClientBuilder. + */ + public ContainerAppsApiClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerAppsApiClientImpl with the provided parameters. + * + * @return an instance of ContainerAppsApiClientImpl. + */ + public ContainerAppsApiClientImpl buildClient() { + if (endpoint == null) { + this.endpoint = "https://management.azure.com"; + } + if (environment == null) { + this.environment = AzureEnvironment.AZURE; + } + if (defaultPollInterval == null) { + this.defaultPollInterval = Duration.ofSeconds(30); + } + if (pipeline == null) { + this.pipeline = + new HttpPipelineBuilder() + .policies(new UserAgentPolicy(), new RetryPolicy(), new CookiePolicy()) + .build(); + } + if (serializerAdapter == null) { + this.serializerAdapter = SerializerFactory.createDefaultManagementSerializerAdapter(); + } + ContainerAppsApiClientImpl client = + new ContainerAppsApiClientImpl( + pipeline, serializerAdapter, defaultPollInterval, environment, subscriptionId, endpoint); + return client; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientImpl.java new file mode 100644 index 0000000000000..43095ac3596e9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsApiClientImpl.java @@ -0,0 +1,377 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpResponse; +import com.azure.core.http.rest.Response; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.management.polling.PollerFactory; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.AsyncPollResponse; +import com.azure.core.util.polling.LongRunningOperationStatus; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.core.util.serializer.SerializerEncoding; +import com.azure.resourcemanager.app.fluent.ContainerAppsApiClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionReplicasClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionsClient; +import com.azure.resourcemanager.app.fluent.ContainerAppsSourceControlsClient; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsClient; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsStoragesClient; +import com.azure.resourcemanager.app.fluent.OperationsClient; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.time.Duration; +import java.util.Map; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** Initializes a new instance of the ContainerAppsApiClientImpl type. */ +@ServiceClient(builder = ContainerAppsApiClientBuilder.class) +public final class ContainerAppsApiClientImpl implements ContainerAppsApiClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsApiClientImpl.class); + + /** The ID of the target subscription. */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** server parameter. */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** Api Version. */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** The HTTP pipeline to send requests through. */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** The serializer to serialize an object into a string. */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** The default poll interval for long-running operation. */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** The ContainerAppsClient object to access its operations. */ + private final ContainerAppsClient containerApps; + + /** + * Gets the ContainerAppsClient object to access its operations. + * + * @return the ContainerAppsClient object. + */ + public ContainerAppsClient getContainerApps() { + return this.containerApps; + } + + /** The ContainerAppsRevisionsClient object to access its operations. */ + private final ContainerAppsRevisionsClient containerAppsRevisions; + + /** + * Gets the ContainerAppsRevisionsClient object to access its operations. + * + * @return the ContainerAppsRevisionsClient object. + */ + public ContainerAppsRevisionsClient getContainerAppsRevisions() { + return this.containerAppsRevisions; + } + + /** The ContainerAppsRevisionReplicasClient object to access its operations. */ + private final ContainerAppsRevisionReplicasClient containerAppsRevisionReplicas; + + /** + * Gets the ContainerAppsRevisionReplicasClient object to access its operations. + * + * @return the ContainerAppsRevisionReplicasClient object. + */ + public ContainerAppsRevisionReplicasClient getContainerAppsRevisionReplicas() { + return this.containerAppsRevisionReplicas; + } + + /** The ManagedEnvironmentsClient object to access its operations. */ + private final ManagedEnvironmentsClient managedEnvironments; + + /** + * Gets the ManagedEnvironmentsClient object to access its operations. + * + * @return the ManagedEnvironmentsClient object. + */ + public ManagedEnvironmentsClient getManagedEnvironments() { + return this.managedEnvironments; + } + + /** The OperationsClient object to access its operations. */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + + /** The ContainerAppsSourceControlsClient object to access its operations. */ + private final ContainerAppsSourceControlsClient containerAppsSourceControls; + + /** + * Gets the ContainerAppsSourceControlsClient object to access its operations. + * + * @return the ContainerAppsSourceControlsClient object. + */ + public ContainerAppsSourceControlsClient getContainerAppsSourceControls() { + return this.containerAppsSourceControls; + } + + /** The ManagedEnvironmentsStoragesClient object to access its operations. */ + private final ManagedEnvironmentsStoragesClient managedEnvironmentsStorages; + + /** + * Gets the ManagedEnvironmentsStoragesClient object to access its operations. + * + * @return the ManagedEnvironmentsStoragesClient object. + */ + public ManagedEnvironmentsStoragesClient getManagedEnvironmentsStorages() { + return this.managedEnvironmentsStorages; + } + + /** + * Initializes an instance of ContainerAppsApiClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The ID of the target subscription. + * @param endpoint server parameter. + */ + ContainerAppsApiClientImpl( + HttpPipeline httpPipeline, + SerializerAdapter serializerAdapter, + Duration defaultPollInterval, + AzureEnvironment environment, + String subscriptionId, + String endpoint) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2022-01-01-preview"; + this.containerApps = new ContainerAppsClientImpl(this); + this.containerAppsRevisions = new ContainerAppsRevisionsClientImpl(this); + this.containerAppsRevisionReplicas = new ContainerAppsRevisionReplicasClientImpl(this); + this.managedEnvironments = new ManagedEnvironmentsClientImpl(this); + this.operations = new OperationsClientImpl(this); + this.containerAppsSourceControls = new ContainerAppsSourceControlsClientImpl(this); + this.managedEnvironmentsStorages = new ManagedEnvironmentsStoragesClientImpl(this); + } + + /** + * Gets default client context. + * + * @return the default client context. + */ + public Context getContext() { + return Context.NONE; + } + + /** + * Merges default client context with provided context. + * + * @param context the context to be merged with default client context. + * @return the merged context. + */ + public Context mergeContext(Context context) { + for (Map.Entry entry : this.getContext().getValues().entrySet()) { + context = context.addData(entry.getKey(), entry.getValue()); + } + return context; + } + + /** + * Gets long running operation result. + * + * @param activationResponse the response of activation operation. + * @param httpPipeline the http pipeline. + * @param pollResultType type of poll result. + * @param finalResultType type of final result. + * @param context the context shared by all requests. + * @param type of poll result. + * @param type of final result. + * @return poller flux for poll result and final result. + */ + public PollerFlux, U> getLroResult( + Mono>> activationResponse, + HttpPipeline httpPipeline, + Type pollResultType, + Type finalResultType, + Context context) { + return PollerFactory + .create( + serializerAdapter, + httpPipeline, + pollResultType, + finalResultType, + defaultPollInterval, + activationResponse, + context); + } + + /** + * Gets the final result, or an error, based on last async poll response. + * + * @param response the last async poll response. + * @param type of poll result. + * @param type of final result. + * @return the final result, or an error. + */ + public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { + if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { + String errorMessage; + ManagementError managementError = null; + HttpResponse errorResponse = null; + PollResult.Error lroError = response.getValue().getError(); + if (lroError != null) { + errorResponse = + new HttpResponseImpl( + lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); + + errorMessage = response.getValue().getError().getMessage(); + String errorBody = response.getValue().getError().getResponseBody(); + if (errorBody != null) { + // try to deserialize error body to ManagementError + try { + managementError = + this + .getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); + if (managementError.getCode() == null || managementError.getMessage() == null) { + managementError = null; + } + } catch (IOException | RuntimeException ioe) { + logger.logThrowableAsWarning(ioe); + } + } + } else { + // fallback to default error message + errorMessage = "Long running operation failed."; + } + if (managementError == null) { + // fallback to default ManagementError + managementError = new ManagementError(response.getStatus().toString(), errorMessage); + } + return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); + } else { + return response.getFinalResult(); + } + } + + private static final class HttpResponseImpl extends HttpResponse { + private final int statusCode; + + private final byte[] responseBody; + + private final HttpHeaders httpHeaders; + + HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { + super(null); + this.statusCode = statusCode; + this.httpHeaders = httpHeaders; + this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); + } + + public int getStatusCode() { + return statusCode; + } + + public String getHeaderValue(String s) { + return httpHeaders.getValue(s); + } + + public HttpHeaders getHeaders() { + return httpHeaders; + } + + public Flux getBody() { + return Flux.just(ByteBuffer.wrap(responseBody)); + } + + public Mono getBodyAsByteArray() { + return Mono.just(responseBody); + } + + public Mono getBodyAsString() { + return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); + } + + public Mono getBodyAsString(Charset charset) { + return Mono.just(new String(responseBody, charset)); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsClientImpl.java new file mode 100644 index 0000000000000..ccdc310924fd1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsClientImpl.java @@ -0,0 +1,1447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.Patch; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.app.fluent.ContainerAppsClient; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.azure.resourcemanager.app.models.ContainerAppCollection; +import com.azure.resourcemanager.app.models.ContainerAppPatch; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +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 ContainerAppsClient. */ +public final class ContainerAppsClientImpl implements ContainerAppsClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(ContainerAppsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerApps to be used by the proxy service + * to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ContainerAppsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/containerApps") + @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/containerApps") + @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/containerApps" + + "/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContainerAppInner containerAppEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Patch( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ContainerAppPatch containerAppEnvelope, + @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 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 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 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 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 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 in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get the Container Apps 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 in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Container Apps 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 in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get the Container Apps 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 in a given subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the Container Apps 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 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 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 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 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 in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get the Container Apps 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 in a given resource group. + */ + @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 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 in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get the Container Apps 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 in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 App along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 App on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupAsync(resourceGroupName, name).block(); + } + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (containerAppEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); + } else { + containerAppEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (containerAppEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); + } else { + containerAppEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppInner> beginCreateOrUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, containerAppEnvelope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ContainerAppInner.class, + ContainerAppInner.class, + this.client.getContext()); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ContainerAppInner> beginCreateOrUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, containerAppEnvelope, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), ContainerAppInner.class, ContainerAppInner.class, context); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppInner> beginCreateOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, containerAppEnvelope).getSyncPoller(); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ContainerAppInner> beginCreateOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, containerAppEnvelope, context).getSyncPoller(); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, containerAppEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, containerAppEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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 ContainerAppInner createOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope) { + return createOrUpdateAsync(resourceGroupName, name, containerAppEnvelope).block(); + } + + /** + * Description for Create or update a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @param containerAppEnvelope Properties used to create a container app. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ContainerAppInner createOrUpdate( + String resourceGroupName, String name, ContainerAppInner containerAppEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, name, containerAppEnvelope, context).block(); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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 name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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 name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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 name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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 name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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 name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @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 name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (containerAppEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); + } else { + containerAppEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (containerAppEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppEnvelope is required and cannot be null.")); + } else { + containerAppEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + containerAppEnvelope, + accept, + context); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope) { + return updateWithResponseAsync(resourceGroupName, name, containerAppEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 ContainerAppInner update(String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope) { + return updateAsync(resourceGroupName, name, containerAppEnvelope).block(); + } + + /** + * Patches a Container App. Currently only patching of tags is supported. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String name, ContainerAppPatch containerAppEnvelope, Context context) { + return updateWithResponseAsync(resourceGroupName, name, containerAppEnvelope, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 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 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 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 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 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 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 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/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsImpl.java new file mode 100644 index 0000000000000..30c95946e7d39 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsImpl.java @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ContainerAppsClient; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.azure.resourcemanager.app.models.ContainerApp; +import com.azure.resourcemanager.app.models.ContainerApps; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsImpl implements ContainerApps { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsImpl.class); + + private final ContainerAppsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsImpl( + ContainerAppsClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ContainerAppImpl(inner1, this.manager())); + } + + public ContainerApp getByResourceGroup(String resourceGroupName, String name) { + ContainerAppInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ContainerAppImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ContainerAppImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ContainerApp 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 name = Utils.getValueFromIdByName(id, "containerApps"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, 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 name = Utils.getValueFromIdByName(id, "containerApps"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, 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 name = Utils.getValueFromIdByName(id, "containerApps"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + this.delete(resourceGroupName, name, 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 name = Utils.getValueFromIdByName(id, "containerApps"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ContainerAppsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public ContainerAppImpl define(String name) { + return new ContainerAppImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasClientImpl.java new file mode 100644 index 0000000000000..455a601e67cd9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasClientImpl.java @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionReplicasClient; +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainerAppsRevisionReplicasClient. */ +public final class ContainerAppsRevisionReplicasClientImpl implements ContainerAppsRevisionReplicasClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsRevisionReplicasClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsRevisionReplicasService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsRevisionReplicasClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsRevisionReplicasClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create( + ContainerAppsRevisionReplicasService.class, + client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisionReplicas to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ContainerAppsRevisionReplicasService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{revisionName}/replicas/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getReplica( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("revisionName") String revisionName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{revisionName}/replicas") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listReplicas( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("revisionName") String revisionName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @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 replica for a Container App Revision along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getReplicaWithResponseAsync( + String resourceGroupName, String containerAppName, String revisionName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getReplica( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + revisionName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @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 replica for a Container App Revision along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getReplicaWithResponseAsync( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getReplica( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + revisionName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @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 replica for a Container App Revision on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getReplicaAsync( + String resourceGroupName, String containerAppName, String revisionName, String name) { + return getReplicaWithResponseAsync(resourceGroupName, containerAppName, revisionName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @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 replica for a Container App Revision. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicaInner getReplica( + String resourceGroupName, String containerAppName, String revisionName, String name) { + return getReplicaAsync(resourceGroupName, containerAppName, revisionName, name).block(); + } + + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @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 replica for a Container App Revision along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getReplicaWithResponse( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context) { + return getReplicaWithResponseAsync(resourceGroupName, containerAppName, revisionName, name, context).block(); + } + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @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 Revision Replicas collection ARM resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listReplicasWithResponseAsync( + String resourceGroupName, String containerAppName, String revisionName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listReplicas( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + revisionName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @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 Revision Replicas collection ARM resource along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listReplicasWithResponseAsync( + String resourceGroupName, String containerAppName, String revisionName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (revisionName == null) { + return Mono.error(new IllegalArgumentException("Parameter revisionName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listReplicas( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + revisionName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @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 Revision Replicas collection ARM resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listReplicasAsync( + String resourceGroupName, String containerAppName, String revisionName) { + return listReplicasWithResponseAsync(resourceGroupName, containerAppName, revisionName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @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 Revision Replicas collection ARM resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ReplicaCollectionInner listReplicas(String resourceGroupName, String containerAppName, String revisionName) { + return listReplicasAsync(resourceGroupName, containerAppName, revisionName).block(); + } + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @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 Revision Replicas collection ARM resource along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listReplicasWithResponse( + String resourceGroupName, String containerAppName, String revisionName, Context context) { + return listReplicasWithResponseAsync(resourceGroupName, containerAppName, revisionName, context).block(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasImpl.java new file mode 100644 index 0000000000000..3eab61d4de265 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionReplicasImpl.java @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionReplicasClient; +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import com.azure.resourcemanager.app.models.ContainerAppsRevisionReplicas; +import com.azure.resourcemanager.app.models.Replica; +import com.azure.resourcemanager.app.models.ReplicaCollection; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsRevisionReplicasImpl implements ContainerAppsRevisionReplicas { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsRevisionReplicasImpl.class); + + private final ContainerAppsRevisionReplicasClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsRevisionReplicasImpl( + ContainerAppsRevisionReplicasClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Replica getReplica(String resourceGroupName, String containerAppName, String revisionName, String name) { + ReplicaInner inner = this.serviceClient().getReplica(resourceGroupName, containerAppName, revisionName, name); + if (inner != null) { + return new ReplicaImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getReplicaWithResponse( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context) { + Response inner = + this + .serviceClient() + .getReplicaWithResponse(resourceGroupName, containerAppName, revisionName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicaImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ReplicaCollection listReplicas(String resourceGroupName, String containerAppName, String revisionName) { + ReplicaCollectionInner inner = + this.serviceClient().listReplicas(resourceGroupName, containerAppName, revisionName); + if (inner != null) { + return new ReplicaCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listReplicasWithResponse( + String resourceGroupName, String containerAppName, String revisionName, Context context) { + Response inner = + this.serviceClient().listReplicasWithResponse(resourceGroupName, containerAppName, revisionName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ReplicaCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + private ContainerAppsRevisionReplicasClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsClientImpl.java new file mode 100644 index 0000000000000..27ab52d9a1bb7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsClientImpl.java @@ -0,0 +1,1042 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ContainerAppsRevisionsClient; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.app.models.RevisionCollection; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ContainerAppsRevisionsClient. */ +public final class ContainerAppsRevisionsClientImpl implements ContainerAppsRevisionsClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsRevisionsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsRevisionsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsRevisionsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsRevisionsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create(ContainerAppsRevisionsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsRevisions to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ContainerAppsRevisionsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listRevisions( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getRevision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{name}/activate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> activateRevision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{name}/deactivate") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> deactivateRevision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Post( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/revisions/{name}/restart") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> restartRevision( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listRevisionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @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 Revisions for a given Container App along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsSinglePageAsync( + String resourceGroupName, String containerAppName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listRevisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + 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 Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @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 Revisions for a given Container App along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsSinglePageAsync( + String resourceGroupName, String containerAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listRevisions( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + this.client.getApiVersion(), + accept, + context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @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 Revisions for a given Container App. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRevisionsAsync(String resourceGroupName, String containerAppName) { + return new PagedFlux<>( + () -> listRevisionsSinglePageAsync(resourceGroupName, containerAppName), + nextLink -> listRevisionsNextSinglePageAsync(nextLink)); + } + + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @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 Revisions for a given Container App. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listRevisionsAsync( + String resourceGroupName, String containerAppName, Context context) { + return new PagedFlux<>( + () -> listRevisionsSinglePageAsync(resourceGroupName, containerAppName, context), + nextLink -> listRevisionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @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 Revisions for a given Container App. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRevisions(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(listRevisionsAsync(resourceGroupName, containerAppName)); + } + + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @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 Revisions for a given Container App. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listRevisions( + String resourceGroupName, String containerAppName, Context context) { + return new PagedIterable<>(listRevisionsAsync(resourceGroupName, containerAppName, context)); + } + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 revision of a Container App along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 revision of a Container App along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .getRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 revision of a Container App on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getRevisionAsync(String resourceGroupName, String containerAppName, String name) { + return getRevisionWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 revision of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RevisionInner getRevision(String resourceGroupName, String containerAppName, String name) { + return getRevisionAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 revision of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return getRevisionWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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> activateRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .activateRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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> activateRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .activateRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 activateRevisionAsync(String resourceGroupName, String containerAppName, String name) { + return activateRevisionWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 activateRevision(String resourceGroupName, String containerAppName, String name) { + activateRevisionAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 activateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return activateRevisionWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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> deactivateRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .deactivateRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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> deactivateRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .deactivateRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 deactivateRevisionAsync(String resourceGroupName, String containerAppName, String name) { + return deactivateRevisionWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 deactivateRevision(String resourceGroupName, String containerAppName, String name) { + deactivateRevisionAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 deactivateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return deactivateRevisionWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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> restartRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .restartRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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> restartRevisionWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .restartRevision( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 restartRevisionAsync(String resourceGroupName, String containerAppName, String name) { + return restartRevisionWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap((Response res) -> Mono.empty()); + } + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 restartRevision(String resourceGroupName, String containerAppName, String name) { + restartRevisionAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @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 restartRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return restartRevisionWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 Revisions collection ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsNextSinglePageAsync(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.listRevisionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Revisions collection ARM resource along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listRevisionsNextSinglePageAsync(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 + .listRevisionsNext(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/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsImpl.java new file mode 100644 index 0000000000000..db80debf0f393 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsRevisionsImpl.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ContainerAppsRevisionsClient; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.azure.resourcemanager.app.models.ContainerAppsRevisions; +import com.azure.resourcemanager.app.models.Revision; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsRevisionsImpl implements ContainerAppsRevisions { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsRevisionsImpl.class); + + private final ContainerAppsRevisionsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsRevisionsImpl( + ContainerAppsRevisionsClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listRevisions(String resourceGroupName, String containerAppName) { + PagedIterable inner = this.serviceClient().listRevisions(resourceGroupName, containerAppName); + return Utils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); + } + + public PagedIterable listRevisions(String resourceGroupName, String containerAppName, Context context) { + PagedIterable inner = + this.serviceClient().listRevisions(resourceGroupName, containerAppName, context); + return Utils.mapPage(inner, inner1 -> new RevisionImpl(inner1, this.manager())); + } + + public Revision getRevision(String resourceGroupName, String containerAppName, String name) { + RevisionInner inner = this.serviceClient().getRevision(resourceGroupName, containerAppName, name); + if (inner != null) { + return new RevisionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + Response inner = + this.serviceClient().getRevisionWithResponse(resourceGroupName, containerAppName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new RevisionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void activateRevision(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().activateRevision(resourceGroupName, containerAppName, name); + } + + public Response activateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return this.serviceClient().activateRevisionWithResponse(resourceGroupName, containerAppName, name, context); + } + + public void deactivateRevision(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().deactivateRevision(resourceGroupName, containerAppName, name); + } + + public Response deactivateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return this.serviceClient().deactivateRevisionWithResponse(resourceGroupName, containerAppName, name, context); + } + + public void restartRevision(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().restartRevision(resourceGroupName, containerAppName, name); + } + + public Response restartRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return this.serviceClient().restartRevisionWithResponse(resourceGroupName, containerAppName, name, context); + } + + private ContainerAppsRevisionsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsClientImpl.java new file mode 100644 index 0000000000000..1b0b045466ec2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsClientImpl.java @@ -0,0 +1,1133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.app.fluent.ContainerAppsSourceControlsClient; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.app.models.SourceControlCollection; +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 ContainerAppsSourceControlsClient. */ +public final class ContainerAppsSourceControlsClientImpl implements ContainerAppsSourceControlsClient { + private final ClientLogger logger = new ClientLogger(ContainerAppsSourceControlsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ContainerAppsSourceControlsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ContainerAppsSourceControlsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ContainerAppsSourceControlsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create( + ContainerAppsSourceControlsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientContainerAppsSourceControls to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ContainerAppsSourceControlsService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/sourcecontrols") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByContainerApp( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/sourcecontrols/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Put( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/sourcecontrols/{name}") + @ExpectedResponses({200, 202}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SourceControlInner sourceControlEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App/containerApps" + + "/{containerAppName}/sourcecontrols/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("containerAppName") String containerAppName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listByContainerAppNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @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 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 App SourceControls in a given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppSinglePageAsync( + String resourceGroupName, String containerAppName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .listByContainerApp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + 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 App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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 App SourceControls in a given resource group along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppSinglePageAsync( + String resourceGroupName, String containerAppName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByContainerApp( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + 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 App SourceControls in a given resource group. + * + * @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 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 App SourceControls in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync(String resourceGroupName, String containerAppName) { + return new PagedFlux<>( + () -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink)); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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 App SourceControls in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByContainerAppAsync( + String resourceGroupName, String containerAppName, Context context) { + return new PagedFlux<>( + () -> listByContainerAppSinglePageAsync(resourceGroupName, containerAppName, context), + nextLink -> listByContainerAppNextSinglePageAsync(nextLink, context)); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @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 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 App SourceControls in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + return new PagedIterable<>(listByContainerAppAsync(resourceGroupName, containerAppName)); + } + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 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 App SourceControls in a given resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByContainerApp( + String resourceGroupName, String containerAppName, Context context) { + return new PagedIterable<>(listByContainerAppAsync(resourceGroupName, containerAppName, context)); + } + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 SourceControl of a Container App along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String containerAppName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 SourceControl of a Container App along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 SourceControl of a Container App on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String containerAppName, String name) { + return getWithResponseAsync(resourceGroupName, containerAppName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 SourceControl of a Container App. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlInner get(String resourceGroupName, String containerAppName, String name) { + return getAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 SourceControl of a Container App along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sourceControlEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sourceControlEnvelope is required and cannot be null.")); + } else { + sourceControlEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + sourceControlEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (sourceControlEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter sourceControlEnvelope is required and cannot be null.")); + } else { + sourceControlEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + sourceControlEnvelope, + accept, + context); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SourceControlInner> beginCreateOrUpdateAsync( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + SourceControlInner.class, + SourceControlInner.class, + this.client.getContext()); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SourceControlInner> beginCreateOrUpdateAsync( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope, context); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), SourceControlInner.class, SourceControlInner.class, context); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SourceControlInner> beginCreateOrUpdate( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope) + .getSyncPoller(); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SourceControlInner> beginCreateOrUpdate( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope, context) + .getSyncPoller(); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlInner createOrUpdate( + String resourceGroupName, String containerAppName, String name, SourceControlInner sourceControlEnvelope) { + return createOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope).block(); + } + + /** + * Description for Create or update the SourceControl for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param sourceControlEnvelope Properties used to create a Container App SourceControl. + * @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 SourceControl. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceControlInner createOrUpdate( + String resourceGroupName, + String containerAppName, + String name, + SourceControlInner sourceControlEnvelope, + Context context) { + return createOrUpdateAsync(resourceGroupName, containerAppName, name, sourceControlEnvelope, context).block(); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 containerAppName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 containerAppName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (containerAppName == null) { + return Mono + .error(new IllegalArgumentException("Parameter containerAppName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + containerAppName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String containerAppName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, containerAppName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String containerAppName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + deleteWithResponseAsync(resourceGroupName, containerAppName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String containerAppName, String name) { + return beginDeleteAsync(resourceGroupName, containerAppName, name).getSyncPoller(); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete( + String resourceGroupName, String containerAppName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, name, context).getSyncPoller(); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 containerAppName, String name) { + return beginDeleteAsync(resourceGroupName, containerAppName, name) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 containerAppName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, containerAppName, name, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 containerAppName, String name) { + deleteAsync(resourceGroupName, containerAppName, name).block(); + } + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @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 containerAppName, String name, Context context) { + deleteAsync(resourceGroupName, containerAppName, name, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 sourceControl collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppNextSinglePageAsync(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.listByContainerAppNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return sourceControl collection ARM resource along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByContainerAppNextSinglePageAsync( + 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 + .listByContainerAppNext(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/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsImpl.java new file mode 100644 index 0000000000000..07084c41d1c8c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ContainerAppsSourceControlsImpl.java @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ContainerAppsSourceControlsClient; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.azure.resourcemanager.app.models.ContainerAppsSourceControls; +import com.azure.resourcemanager.app.models.SourceControl; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ContainerAppsSourceControlsImpl implements ContainerAppsSourceControls { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppsSourceControlsImpl.class); + + private final ContainerAppsSourceControlsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ContainerAppsSourceControlsImpl( + ContainerAppsSourceControlsClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByContainerApp(String resourceGroupName, String containerAppName) { + PagedIterable inner = + this.serviceClient().listByContainerApp(resourceGroupName, containerAppName); + return Utils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + + public PagedIterable listByContainerApp( + String resourceGroupName, String containerAppName, Context context) { + PagedIterable inner = + this.serviceClient().listByContainerApp(resourceGroupName, containerAppName, context); + return Utils.mapPage(inner, inner1 -> new SourceControlImpl(inner1, this.manager())); + } + + public SourceControl get(String resourceGroupName, String containerAppName, String name) { + SourceControlInner inner = this.serviceClient().get(resourceGroupName, containerAppName, name); + if (inner != null) { + return new SourceControlImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, containerAppName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new SourceControlImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String containerAppName, String name) { + this.serviceClient().delete(resourceGroupName, containerAppName, name); + } + + public void delete(String resourceGroupName, String containerAppName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, containerAppName, name, context); + } + + public SourceControl 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 containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, name, 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 containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + return this.getWithResponse(resourceGroupName, containerAppName, name, 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 containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + this.delete(resourceGroupName, containerAppName, name, 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 containerAppName = Utils.getValueFromIdByName(id, "containerApps"); + if (containerAppName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'containerApps'.", id))); + } + String name = Utils.getValueFromIdByName(id, "sourcecontrols"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id))); + } + this.delete(resourceGroupName, containerAppName, name, context); + } + + private ContainerAppsSourceControlsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public SourceControlImpl define(String name) { + return new SourceControlImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.java new file mode 100644 index 0000000000000..80ba4f729a080 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentImpl.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.app.implementation; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.EnvironmentProvisioningState; +import com.azure.resourcemanager.app.models.ManagedEnvironment; +import com.azure.resourcemanager.app.models.ManagedEnvironmentPatch; +import com.azure.resourcemanager.app.models.VnetConfiguration; +import java.util.Collections; +import java.util.Map; + +public final class ManagedEnvironmentImpl + implements ManagedEnvironment, ManagedEnvironment.Definition, ManagedEnvironment.Update { + private ManagedEnvironmentInner innerObject; + + private final com.azure.resourcemanager.app.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 SystemData systemData() { + return this.innerModel().systemData(); + } + + public EnvironmentProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public String daprAIInstrumentationKey() { + return this.innerModel().daprAIInstrumentationKey(); + } + + public VnetConfiguration vnetConfiguration() { + return this.innerModel().vnetConfiguration(); + } + + public String deploymentErrors() { + return this.innerModel().deploymentErrors(); + } + + public Boolean internalLoadBalancerEnabled() { + return this.innerModel().internalLoadBalancerEnabled(); + } + + public String defaultDomain() { + return this.innerModel().defaultDomain(); + } + + public String staticIp() { + return this.innerModel().staticIp(); + } + + public AppLogsConfiguration appLogsConfiguration() { + return this.innerModel().appLogsConfiguration(); + } + + public Region region() { + return Region.fromName(this.regionName()); + } + + public String regionName() { + return this.location(); + } + + public ManagedEnvironmentInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String name; + + private ManagedEnvironmentPatch updateEnvironmentEnvelope; + + public ManagedEnvironmentImpl withExistingResourceGroup(String resourceGroupName) { + this.resourceGroupName = resourceGroupName; + return this; + } + + public ManagedEnvironment create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .createOrUpdate(resourceGroupName, name, this.innerModel(), Context.NONE); + return this; + } + + public ManagedEnvironment create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .createOrUpdate(resourceGroupName, name, this.innerModel(), context); + return this; + } + + ManagedEnvironmentImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new ManagedEnvironmentInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ManagedEnvironmentImpl update() { + this.updateEnvironmentEnvelope = new ManagedEnvironmentPatch(); + return this; + } + + public ManagedEnvironment apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .updateWithResponse(resourceGroupName, name, updateEnvironmentEnvelope, Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironment apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .updateWithResponse(resourceGroupName, name, updateEnvironmentEnvelope, context) + .getValue(); + return this; + } + + ManagedEnvironmentImpl( + ManagedEnvironmentInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + } + + public ManagedEnvironment refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, name, Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironment refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironments() + .getByResourceGroupWithResponse(resourceGroupName, name, context) + .getValue(); + return this; + } + + public ManagedEnvironmentImpl withRegion(Region location) { + this.innerModel().withLocation(location.toString()); + return this; + } + + public ManagedEnvironmentImpl withRegion(String location) { + this.innerModel().withLocation(location); + return this; + } + + public ManagedEnvironmentImpl withTags(Map tags) { + if (isInCreateMode()) { + this.innerModel().withTags(tags); + return this; + } else { + this.updateEnvironmentEnvelope.withTags(tags); + return this; + } + } + + public ManagedEnvironmentImpl withDaprAIInstrumentationKey(String daprAIInstrumentationKey) { + this.innerModel().withDaprAIInstrumentationKey(daprAIInstrumentationKey); + return this; + } + + public ManagedEnvironmentImpl withVnetConfiguration(VnetConfiguration vnetConfiguration) { + this.innerModel().withVnetConfiguration(vnetConfiguration); + return this; + } + + public ManagedEnvironmentImpl withInternalLoadBalancerEnabled(Boolean internalLoadBalancerEnabled) { + this.innerModel().withInternalLoadBalancerEnabled(internalLoadBalancerEnabled); + return this; + } + + public ManagedEnvironmentImpl withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration) { + this.innerModel().withAppLogsConfiguration(appLogsConfiguration); + return this; + } + + private boolean isInCreateMode() { + return this.innerModel().id() == null; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStorageImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStorageImpl.java new file mode 100644 index 0000000000000..128a3be94f1ee --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStorageImpl.java @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorage; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorageProperties; + +public final class ManagedEnvironmentStorageImpl + implements ManagedEnvironmentStorage, ManagedEnvironmentStorage.Definition, ManagedEnvironmentStorage.Update { + private ManagedEnvironmentStorageInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public ManagedEnvironmentStorageProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public ManagedEnvironmentStorageInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String envName; + + private String name; + + public ManagedEnvironmentStorageImpl withExistingManagedEnvironment(String resourceGroupName, String envName) { + this.resourceGroupName = resourceGroupName; + this.envName = envName; + return this; + } + + public ManagedEnvironmentStorage create() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, envName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironmentStorage create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, envName, name, this.innerModel(), context) + .getValue(); + return this; + } + + ManagedEnvironmentStorageImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new ManagedEnvironmentStorageInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public ManagedEnvironmentStorageImpl update() { + return this; + } + + public ManagedEnvironmentStorage apply() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, envName, name, this.innerModel(), Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironmentStorage apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .createOrUpdateWithResponse(resourceGroupName, envName, name, this.innerModel(), context) + .getValue(); + return this; + } + + ManagedEnvironmentStorageImpl( + ManagedEnvironmentStorageInner innerObject, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.envName = Utils.getValueFromIdByName(innerObject.id(), "managedEnvironments"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "storages"); + } + + public ManagedEnvironmentStorage refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .getWithResponse(resourceGroupName, envName, name, Context.NONE) + .getValue(); + return this; + } + + public ManagedEnvironmentStorage refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getManagedEnvironmentsStorages() + .getWithResponse(resourceGroupName, envName, name, context) + .getValue(); + return this; + } + + public ManagedEnvironmentStorageImpl withProperties(ManagedEnvironmentStorageProperties properties) { + this.innerModel().withProperties(properties); + return this; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStoragesCollectionImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStoragesCollectionImpl.java new file mode 100644 index 0000000000000..30334bca0f357 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentStoragesCollectionImpl.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorage; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStoragesCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ManagedEnvironmentStoragesCollectionImpl implements ManagedEnvironmentStoragesCollection { + private ManagedEnvironmentStoragesCollectionInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + ManagedEnvironmentStoragesCollectionImpl( + ManagedEnvironmentStoragesCollectionInner innerObject, + com.azure.resourcemanager.app.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 ManagedEnvironmentStorageImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ManagedEnvironmentStoragesCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsClientImpl.java new file mode 100644 index 0000000000000..a87966ffb0482 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsClientImpl.java @@ -0,0 +1,1460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsClient; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import com.azure.resourcemanager.app.models.ManagedEnvironmentPatch; +import com.azure.resourcemanager.app.models.ManagedEnvironmentsCollection; +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 ManagedEnvironmentsClient. */ +public final class ManagedEnvironmentsClientImpl implements ManagedEnvironmentsClient { + private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedEnvironmentsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedEnvironmentsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedEnvironmentsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(ManagedEnvironmentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedEnvironments to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ManagedEnvironmentsService { + @Headers({"Content-Type: application/json"}) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.App/managedEnvironments") + @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" + + "/managedEnvironments") + @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" + + "/managedEnvironments/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> getByResourceGroup( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @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/{name}") + @ExpectedResponses({200, 201}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedEnvironmentInner environmentEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{name}") + @ExpectedResponses({200, 202, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono>> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @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/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> update( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedEnvironmentPatch environmentEnvelope, + @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 all Managed Environments for a 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 all Managed Environments for a 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 all Managed Environments for a 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 all Managed Environments for a 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 all Managed Environments for a 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 all Managed Environments for a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>( + () -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Get all Managed Environments for a 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 all Managed Environments for a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all Managed Environments for a 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 all Managed Environments for a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Get all Managed Environments for a 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 all Managed Environments for a subscription. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Managed Environments in a 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 all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Managed Environments in a 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 all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Managed Environments in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Get all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Managed Environments in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>( + () -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Get all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Managed Environments in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Get all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 the Managed Environments in a resource group. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 properties of a Managed Environment used to host container apps along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .getByResourceGroup( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 properties of a Managed Environment used to host container apps along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 properties of a Managed Environment used to host container apps on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String name) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 properties of a Managed Environment used to host container apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentInner getByResourceGroup(String resourceGroupName, String name) { + return getByResourceGroupAsync(resourceGroupName, name).block(); + } + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 properties of a Managed Environment used to host container apps along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, name, context).block(); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 an environment for hosting container apps along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (environmentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); + } else { + environmentEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (environmentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); + } else { + environmentEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 an environment for hosting container apps along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedEnvironmentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, environmentEnvelope); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedEnvironmentInner.class, + ManagedEnvironmentInner.class, + this.client.getContext()); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ManagedEnvironmentInner> beginCreateOrUpdateAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = + createOrUpdateWithResponseAsync(resourceGroupName, name, environmentEnvelope, context); + return this + .client + .getLroResult( + mono, + this.client.getHttpPipeline(), + ManagedEnvironmentInner.class, + ManagedEnvironmentInner.class, + context); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 an environment for hosting container apps along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, environmentEnvelope).getSyncPoller(); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ManagedEnvironmentInner> beginCreateOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, environmentEnvelope, context).getSyncPoller(); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 an environment for hosting container apps on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + return beginCreateOrUpdateAsync(resourceGroupName, name, environmentEnvelope) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, name, environmentEnvelope, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 an environment for hosting container apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentInner createOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope) { + return createOrUpdateAsync(resourceGroupName, name, environmentEnvelope).block(); + } + + /** + * Creates or updates a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 ManagedEnvironmentInner createOrUpdate( + String resourceGroupName, String name, ManagedEnvironmentInner environmentEnvelope, Context context) { + return createOrUpdateAsync(resourceGroupName, name, environmentEnvelope, context).block(); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync(String resourceGroupName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteWithResponseAsync( + String resourceGroupName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String name) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name); + return this + .client + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync( + String resourceGroupName, String name, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, name, context); + return this + .client + .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).getSyncPoller(); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).getSyncPoller(); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name) { + return beginDeleteAsync(resourceGroupName, name).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteAsync(String resourceGroupName, String name, Context context) { + return beginDeleteAsync(resourceGroupName, name, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name) { + deleteAsync(resourceGroupName, name).block(); + } + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the 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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String name, Context context) { + deleteAsync(resourceGroupName, name, context).block(); + } + + /** + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 an environment for hosting container apps along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (environmentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); + } else { + environmentEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> updateWithResponseAsync( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (environmentEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter environmentEnvelope is required and cannot be null.")); + } else { + environmentEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .update( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + name, + this.client.getApiVersion(), + environmentEnvelope, + accept, + context); + } + + /** + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 an environment for hosting container apps on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope) { + return updateWithResponseAsync(resourceGroupName, name, environmentEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param environmentEnvelope Configuration details of the 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 an environment for hosting container apps. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentInner update( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope) { + return updateAsync(resourceGroupName, name, environmentEnvelope).block(); + } + + /** + * Patches a Managed Environment. Only patching of tags is supported currently. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 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 along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response updateWithResponse( + String resourceGroupName, String name, ManagedEnvironmentPatch environmentEnvelope, Context context) { + return updateWithResponseAsync(resourceGroupName, name, environmentEnvelope, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink 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 Environments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Environments along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync( + String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws 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 Environments 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 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 Environments 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/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsImpl.java new file mode 100644 index 0000000000000..b3ce9dd0914af --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsImpl.java @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.ManagedEnvironmentsClient; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import com.azure.resourcemanager.app.models.ManagedEnvironment; +import com.azure.resourcemanager.app.models.ManagedEnvironments; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedEnvironmentsImpl implements ManagedEnvironments { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsImpl.class); + + private final ManagedEnvironmentsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ManagedEnvironmentsImpl( + ManagedEnvironmentsClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return Utils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = + this.serviceClient().listByResourceGroup(resourceGroupName, context); + return Utils.mapPage(inner, inner1 -> new ManagedEnvironmentImpl(inner1, this.manager())); + } + + public ManagedEnvironment getByResourceGroup(String resourceGroupName, String name) { + ManagedEnvironmentInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, name); + if (inner != null) { + return new ManagedEnvironmentImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getByResourceGroupWithResponse( + String resourceGroupName, String name, Context context) { + Response inner = + this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedEnvironmentImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void deleteByResourceGroup(String resourceGroupName, String name) { + this.serviceClient().delete(resourceGroupName, name); + } + + public void delete(String resourceGroupName, String name, Context context) { + this.serviceClient().delete(resourceGroupName, name, context); + } + + public ManagedEnvironment 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 name = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, 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 name = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + return this.getByResourceGroupWithResponse(resourceGroupName, name, 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 name = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + this.delete(resourceGroupName, name, 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 name = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + this.delete(resourceGroupName, name, context); + } + + private ManagedEnvironmentsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public ManagedEnvironmentImpl define(String name) { + return new ManagedEnvironmentImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesClientImpl.java new file mode 100644 index 0000000000000..be80422983ed8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesClientImpl.java @@ -0,0 +1,784 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.Delete; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.Get; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Headers; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Put; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsStoragesClient; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in ManagedEnvironmentsStoragesClient. */ +public final class ManagedEnvironmentsStoragesClientImpl implements ManagedEnvironmentsStoragesClient { + private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsStoragesClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final ManagedEnvironmentsStoragesService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of ManagedEnvironmentsStoragesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ManagedEnvironmentsStoragesClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy + .create( + ManagedEnvironmentsStoragesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientManagedEnvironmentsStorages to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface ManagedEnvironmentsStoragesService { + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{envName}/storages") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("envName") String envName, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{envName}/storages/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> get( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("envName") String envName, + @PathParam("name") String name, + @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/{envName}/storages/{name}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> createOrUpdate( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("envName") String envName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") ManagedEnvironmentStorageInner storageEnvelope, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Delete( + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.App" + + "/managedEnvironments/{envName}/storages/{name}") + @ExpectedResponses({200, 204}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> delete( + @HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("envName") String envName, + @PathParam("name") String name, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the 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 collection of Storage for Environments along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String envName) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .list( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the 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 collection of Storage for Environments along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listWithResponseAsync( + String resourceGroupName, String envName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName 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, + envName, + this.client.getApiVersion(), + accept, + context); + } + + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the 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 collection of Storage for Environments on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listAsync(String resourceGroupName, String envName) { + return listWithResponseAsync(resourceGroupName, envName) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the 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 collection of Storage for Environments. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentStoragesCollectionInner list(String resourceGroupName, String envName) { + return listAsync(resourceGroupName, envName).block(); + } + + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the 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 collection of Storage for Environments along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response listWithResponse( + String resourceGroupName, String envName, Context context) { + return listWithResponseAsync(resourceGroupName, envName, context).block(); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 storage for a managedEnvironment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String envName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .get( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 storage for a managedEnvironment along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync( + String resourceGroupName, String envName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + envName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 storage for a managedEnvironment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String envName, String name) { + return getWithResponseAsync(resourceGroupName, envName, name) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 storage for a managedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentStorageInner get(String resourceGroupName, String envName, String name) { + return getAsync(resourceGroupName, envName, name).block(); + } + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 storage for a managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse( + String resourceGroupName, String envName, String name, Context context) { + return getWithResponseAsync(resourceGroupName, envName, name, context).block(); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @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 storage resource for managedEnvironment along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, String envName, String name, ManagedEnvironmentStorageInner storageEnvelope) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (storageEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageEnvelope is required and cannot be null.")); + } else { + storageEnvelope.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + name, + this.client.getApiVersion(), + storageEnvelope, + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @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 storage resource for managedEnvironment along with {@link Response} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createOrUpdateWithResponseAsync( + String resourceGroupName, + String envName, + String name, + ManagedEnvironmentStorageInner storageEnvelope, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + if (storageEnvelope == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageEnvelope is required and cannot be null.")); + } else { + storageEnvelope.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .createOrUpdate( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + name, + this.client.getApiVersion(), + storageEnvelope, + accept, + context); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @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 storage resource for managedEnvironment on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync( + String resourceGroupName, String envName, String name, ManagedEnvironmentStorageInner storageEnvelope) { + return createOrUpdateWithResponseAsync(resourceGroupName, envName, name, storageEnvelope) + .flatMap( + (Response res) -> { + if (res.getValue() != null) { + return Mono.just(res.getValue()); + } else { + return Mono.empty(); + } + }); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @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 storage resource for managedEnvironment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ManagedEnvironmentStorageInner createOrUpdate( + String resourceGroupName, String envName, String name, ManagedEnvironmentStorageInner storageEnvelope) { + return createOrUpdateAsync(resourceGroupName, envName, name, storageEnvelope).block(); + } + + /** + * Create or update storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param storageEnvelope Configuration details of storage. + * @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 storage resource for managedEnvironment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createOrUpdateWithResponse( + String resourceGroupName, + String envName, + String name, + ManagedEnvironmentStorageInner storageEnvelope, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, envName, name, storageEnvelope, context).block(); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 envName, String name) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> + service + .delete( + this.client.getEndpoint(), + this.client.getSubscriptionId(), + resourceGroupName, + envName, + name, + this.client.getApiVersion(), + accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 envName, String name, Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (envName == null) { + return Mono.error(new IllegalArgumentException("Parameter envName is required and cannot be null.")); + } + if (name == null) { + return Mono.error(new IllegalArgumentException("Parameter name 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, + envName, + name, + this.client.getApiVersion(), + accept, + context); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 envName, String name) { + return deleteWithResponseAsync(resourceGroupName, envName, name).flatMap((Response res) -> Mono.empty()); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 envName, String name) { + deleteAsync(resourceGroupName, envName, name).block(); + } + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @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 envName, String name, Context context) { + return deleteWithResponseAsync(resourceGroupName, envName, name, context).block(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesImpl.java new file mode 100644 index 0000000000000..1d69637367247 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ManagedEnvironmentsStoragesImpl.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.ManagedEnvironmentsStoragesClient; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorage; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStoragesCollection; +import com.azure.resourcemanager.app.models.ManagedEnvironmentsStorages; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class ManagedEnvironmentsStoragesImpl implements ManagedEnvironmentsStorages { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsStoragesImpl.class); + + private final ManagedEnvironmentsStoragesClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public ManagedEnvironmentsStoragesImpl( + ManagedEnvironmentsStoragesClient innerClient, + com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public ManagedEnvironmentStoragesCollection list(String resourceGroupName, String envName) { + ManagedEnvironmentStoragesCollectionInner inner = this.serviceClient().list(resourceGroupName, envName); + if (inner != null) { + return new ManagedEnvironmentStoragesCollectionImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response listWithResponse( + String resourceGroupName, String envName, Context context) { + Response inner = + this.serviceClient().listWithResponse(resourceGroupName, envName, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedEnvironmentStoragesCollectionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public ManagedEnvironmentStorage get(String resourceGroupName, String envName, String name) { + ManagedEnvironmentStorageInner inner = this.serviceClient().get(resourceGroupName, envName, name); + if (inner != null) { + return new ManagedEnvironmentStorageImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getWithResponse( + String resourceGroupName, String envName, String name, Context context) { + Response inner = + this.serviceClient().getWithResponse(resourceGroupName, envName, name, context); + if (inner != null) { + return new SimpleResponse<>( + inner.getRequest(), + inner.getStatusCode(), + inner.getHeaders(), + new ManagedEnvironmentStorageImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String envName, String name) { + this.serviceClient().delete(resourceGroupName, envName, name); + } + + public Response deleteWithResponse(String resourceGroupName, String envName, String name, Context context) { + return this.serviceClient().deleteWithResponse(resourceGroupName, envName, name, context); + } + + public ManagedEnvironmentStorage 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 envName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (envName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + return this.getWithResponse(resourceGroupName, envName, name, 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 envName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (envName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + return this.getWithResponse(resourceGroupName, envName, name, 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 envName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (envName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + this.deleteWithResponse(resourceGroupName, envName, name, 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 envName = Utils.getValueFromIdByName(id, "managedEnvironments"); + if (envName == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String + .format( + "The resource ID '%s' is not valid. Missing path segment 'managedEnvironments'.", id))); + } + String name = Utils.getValueFromIdByName(id, "storages"); + if (name == null) { + throw logger + .logExceptionAsError( + new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'storages'.", id))); + } + return this.deleteWithResponse(resourceGroupName, envName, name, context); + } + + private ManagedEnvironmentsStoragesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + public ManagedEnvironmentStorageImpl define(String name) { + return new ManagedEnvironmentStorageImpl(name, this.manager()); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationDetailImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationDetailImpl.java new file mode 100644 index 0000000000000..9be7dbe741683 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationDetailImpl.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.app.models.OperationDetail; +import com.azure.resourcemanager.app.models.OperationDisplay; + +public final class OperationDetailImpl implements OperationDetail { + private OperationDetailInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + OperationDetailImpl( + OperationDetailInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String name() { + return this.innerModel().name(); + } + + public Boolean isDataAction() { + return this.innerModel().isDataAction(); + } + + public OperationDisplay display() { + return this.innerModel().display(); + } + + public String origin() { + return this.innerModel().origin(); + } + + public OperationDetailInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsClientImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsClientImpl.java new file mode 100644 index 0000000000000..ad690a4074a8a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsClientImpl.java @@ -0,0 +1,273 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.OperationsClient; +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.app.models.AvailableOperations; +import com.azure.resourcemanager.app.models.DefaultErrorResponseErrorException; +import reactor.core.publisher.Mono; + +/** An instance of this class provides access to all the operations defined in OperationsClient. */ +public final class OperationsClientImpl implements OperationsClient { + private final ClientLogger logger = new ClientLogger(OperationsClientImpl.class); + + /** The proxy service used to perform REST calls. */ + private final OperationsService service; + + /** The service client containing this operation class. */ + private final ContainerAppsApiClientImpl client; + + /** + * Initializes an instance of OperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + OperationsClientImpl(ContainerAppsApiClientImpl client) { + this.service = + RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerAppsApiClientOperations to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerAppsApiClie") + private interface OperationsService { + @Headers({"Content-Type: application/json"}) + @Get("/providers/Microsoft.App/operations") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> list( + @HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, + Context context); + + @Headers({"Content-Type: application/json"}) + @Get("{nextLink}") + @ExpectedResponses({200}) + @UnexpectedResponseExceptionType(DefaultErrorResponseErrorException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, + Context context); + } + + /** + * Lists all of the available RP operations. + * + * @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 available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all of the available RP operations. + * + * @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 available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(Context context) { + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } + + /** + * Lists all of the available RP operations. + * + * @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 available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available RP operations. + * + * @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 available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>( + () -> listSinglePageAsync(context), nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all of the available RP operations. + * + * @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 available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all of the available RP operations. + * + * @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 available operations of the service. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The nextLink parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws DefaultErrorResponseErrorException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return available operations of the service along with {@link PagedResponse} on successful completion of {@link + * Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono + .error( + new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listNext(nextLink, this.client.getEndpoint(), accept, context) + .map( + res -> + new PagedResponseBase<>( + res.getRequest(), + res.getStatusCode(), + res.getHeaders(), + res.getValue().value(), + res.getValue().nextLink(), + null)); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..f55cc5e8ee4bb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/OperationsImpl.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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.app.fluent.OperationsClient; +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; +import com.azure.resourcemanager.app.models.OperationDetail; +import com.azure.resourcemanager.app.models.Operations; +import com.fasterxml.jackson.annotation.JsonIgnore; + +public final class OperationsImpl implements Operations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationsImpl.class); + + private final OperationsClient innerClient; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return Utils.mapPage(inner, inner1 -> new OperationDetailImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return Utils.mapPage(inner, inner1 -> new OperationDetailImpl(inner1, this.manager())); + } + + private OperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaCollectionImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaCollectionImpl.java new file mode 100644 index 0000000000000..9da02e26176d0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaCollectionImpl.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.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import com.azure.resourcemanager.app.models.Replica; +import com.azure.resourcemanager.app.models.ReplicaCollection; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public final class ReplicaCollectionImpl implements ReplicaCollection { + private ReplicaCollectionInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + ReplicaCollectionImpl( + ReplicaCollectionInner innerObject, com.azure.resourcemanager.app.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 ReplicaImpl(inner1, this.manager())).collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } + } + + public ReplicaCollectionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaImpl.java new file mode 100644 index 0000000000000..c3f368337a79f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/ReplicaImpl.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import com.azure.resourcemanager.app.models.Replica; +import com.azure.resourcemanager.app.models.ReplicaContainer; +import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; + +public final class ReplicaImpl implements Replica { + private ReplicaInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + ReplicaImpl(ReplicaInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public OffsetDateTime createdTime() { + return this.innerModel().createdTime(); + } + + public List containers() { + List inner = this.innerModel().containers(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public ReplicaInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/RevisionImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/RevisionImpl.java new file mode 100644 index 0000000000000..dd875dd339172 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/RevisionImpl.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.azure.resourcemanager.app.models.Revision; +import com.azure.resourcemanager.app.models.RevisionHealthState; +import com.azure.resourcemanager.app.models.RevisionProvisioningState; +import com.azure.resourcemanager.app.models.Template; +import java.time.OffsetDateTime; + +public final class RevisionImpl implements Revision { + private RevisionInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + RevisionImpl(RevisionInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public OffsetDateTime createdTime() { + return this.innerModel().createdTime(); + } + + public String fqdn() { + return this.innerModel().fqdn(); + } + + public Template template() { + return this.innerModel().template(); + } + + public Boolean active() { + return this.innerModel().active(); + } + + public Integer replicas() { + return this.innerModel().replicas(); + } + + public Integer trafficWeight() { + return this.innerModel().trafficWeight(); + } + + public String provisioningError() { + return this.innerModel().provisioningError(); + } + + public RevisionHealthState healthState() { + return this.innerModel().healthState(); + } + + public RevisionProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public RevisionInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SourceControlImpl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SourceControlImpl.java new file mode 100644 index 0000000000000..cb1b7870f8c04 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/SourceControlImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.SourceControl; +import com.azure.resourcemanager.app.models.SourceControlOperationState; + +public final class SourceControlImpl implements SourceControl, SourceControl.Definition, SourceControl.Update { + private SourceControlInner innerObject; + + private final com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SourceControlOperationState operationState() { + return this.innerModel().operationState(); + } + + public String repoUrl() { + return this.innerModel().repoUrl(); + } + + public String branch() { + return this.innerModel().branch(); + } + + public GithubActionConfiguration githubActionConfiguration() { + return this.innerModel().githubActionConfiguration(); + } + + public SourceControlInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.app.ContainerAppsApiManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String containerAppName; + + private String name; + + public SourceControlImpl withExistingContainerApp(String resourceGroupName, String containerAppName) { + this.resourceGroupName = resourceGroupName; + this.containerAppName = containerAppName; + return this; + } + + public SourceControl create() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .createOrUpdate(resourceGroupName, containerAppName, name, this.innerModel(), Context.NONE); + return this; + } + + public SourceControl create(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .createOrUpdate(resourceGroupName, containerAppName, name, this.innerModel(), context); + return this; + } + + SourceControlImpl(String name, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = new SourceControlInner(); + this.serviceManager = serviceManager; + this.name = name; + } + + public SourceControlImpl update() { + return this; + } + + public SourceControl apply() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .createOrUpdate(resourceGroupName, containerAppName, name, this.innerModel(), Context.NONE); + return this; + } + + public SourceControl apply(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .createOrUpdate(resourceGroupName, containerAppName, name, this.innerModel(), context); + return this; + } + + SourceControlImpl( + SourceControlInner innerObject, com.azure.resourcemanager.app.ContainerAppsApiManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.containerAppName = Utils.getValueFromIdByName(innerObject.id(), "containerApps"); + this.name = Utils.getValueFromIdByName(innerObject.id(), "sourcecontrols"); + } + + public SourceControl refresh() { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .getWithResponse(resourceGroupName, containerAppName, name, Context.NONE) + .getValue(); + return this; + } + + public SourceControl refresh(Context context) { + this.innerObject = + serviceManager + .serviceClient() + .getContainerAppsSourceControls() + .getWithResponse(resourceGroupName, containerAppName, name, context) + .getValue(); + return this; + } + + public SourceControlImpl withRepoUrl(String repoUrl) { + this.innerModel().withRepoUrl(repoUrl); + return this; + } + + public SourceControlImpl withBranch(String branch) { + this.innerModel().withBranch(branch); + return this; + } + + public SourceControlImpl withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration) { + this.innerModel().withGithubActionConfiguration(githubActionConfiguration); + return this; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/Utils.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/Utils.java new file mode 100644 index 0000000000000..ee81669841723 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/Utils.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.implementation; + +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.PagedResponse; +import com.azure.core.http.rest.PagedResponseBase; +import com.azure.core.util.CoreUtils; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Function; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import reactor.core.publisher.Flux; + +final class Utils { + static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterator itr = Arrays.stream(id.split("/")).iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && !part.trim().isEmpty()) { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { + if (id == null || pathTemplate == null) { + return null; + } + String parameterNameParentheses = "{" + parameterName + "}"; + List idSegmentsReverted = Arrays.asList(id.split("/")); + List pathSegments = Arrays.asList(pathTemplate.split("/")); + Collections.reverse(idSegmentsReverted); + Iterator idItrReverted = idSegmentsReverted.iterator(); + int pathIndex = pathSegments.size(); + while (idItrReverted.hasNext() && pathIndex > 0) { + String idSegment = idItrReverted.next(); + String pathSegment = pathSegments.get(--pathIndex); + if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { + if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { + if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { + List segments = new ArrayList<>(); + segments.add(idSegment); + idItrReverted.forEachRemaining(segments::add); + Collections.reverse(segments); + if (segments.size() > 0 && segments.get(0).isEmpty()) { + segments.remove(0); + } + return String.join("/", segments); + } else { + return idSegment; + } + } + } + } + return null; + } + + static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { + return new PagedIterableImpl(pageIterable, mapper); + } + + private static final class PagedIterableImpl extends PagedIterable { + + private final PagedIterable pagedIterable; + private final Function mapper; + private final Function, PagedResponse> pageMapper; + + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; + this.mapper = mapper; + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); + } + + @Override + public Stream stream() { + return pagedIterable.stream().map(mapper); + } + + @Override + public Stream> streamByPage() { + return pagedIterable.streamByPage().map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken) { + return pagedIterable.streamByPage(continuationToken).map(pageMapper); + } + + @Override + public Stream> streamByPage(int preferredPageSize) { + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); + } + + @Override + public Stream> streamByPage(String continuationToken, int preferredPageSize) { + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + } + + @Override + public Iterator iterator() { + return new IteratorImpl(pagedIterable.iterator(), mapper); + } + + @Override + public Iterable> iterableByPage() { + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken), pageMapper); + } + + @Override + public Iterable> iterableByPage(int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(preferredPageSize), pageMapper); + } + + @Override + public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { + return new IterableImpl, PagedResponse>( + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + } + } + + private static final class IteratorImpl implements Iterator { + + private final Iterator iterator; + private final Function mapper; + + private IteratorImpl(Iterator iterator, Function mapper) { + this.iterator = iterator; + this.mapper = mapper; + } + + @Override + public boolean hasNext() { + return iterator.hasNext(); + } + + @Override + public S next() { + return mapper.apply(iterator.next()); + } + + @Override + public void remove() { + iterator.remove(); + } + } + + private static final class IterableImpl implements Iterable { + + private final Iterable iterable; + private final Function mapper; + + private IterableImpl(Iterable iterable, Function mapper) { + this.iterable = iterable; + this.mapper = mapper; + } + + @Override + public Iterator iterator() { + return new IteratorImpl(iterable.iterator(), mapper); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/package-info.java new file mode 100644 index 0000000000000..9297b4ac4d699 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/implementation/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the implementations for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app.implementation; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AccessMode.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AccessMode.java new file mode 100644 index 0000000000000..7bf41a5906b9c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AccessMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AccessMode. */ +public final class AccessMode extends ExpandableStringEnum { + /** Static value ReadOnly for AccessMode. */ + public static final AccessMode READ_ONLY = fromString("ReadOnly"); + + /** Static value ReadWrite for AccessMode. */ + public static final AccessMode READ_WRITE = fromString("ReadWrite"); + + /** + * Creates or finds a AccessMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessMode. + */ + @JsonCreator + public static AccessMode fromString(String name) { + return fromString(name, AccessMode.class); + } + + /** @return known AccessMode values. */ + public static Collection values() { + return values(AccessMode.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ActiveRevisionsMode.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ActiveRevisionsMode.java new file mode 100644 index 0000000000000..1d7853fd98a44 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ActiveRevisionsMode.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ActiveRevisionsMode. */ +public final class ActiveRevisionsMode extends ExpandableStringEnum { + /** Static value multiple for ActiveRevisionsMode. */ + public static final ActiveRevisionsMode MULTIPLE = fromString("multiple"); + + /** Static value single for ActiveRevisionsMode. */ + public static final ActiveRevisionsMode SINGLE = fromString("single"); + + /** + * Creates or finds a ActiveRevisionsMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ActiveRevisionsMode. + */ + @JsonCreator + public static ActiveRevisionsMode fromString(String name) { + return fromString(name, ActiveRevisionsMode.class); + } + + /** @return known ActiveRevisionsMode values. */ + public static Collection values() { + return values(ActiveRevisionsMode.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppLogsConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppLogsConfiguration.java new file mode 100644 index 0000000000000..cfac0f5e3e785 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppLogsConfiguration.java @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration of application logs. */ +@Fluent +public final class AppLogsConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AppLogsConfiguration.class); + + /* + * Logs destination + */ + @JsonProperty(value = "destination") + private String destination; + + /* + * Log Analytics configuration + */ + @JsonProperty(value = "logAnalyticsConfiguration") + private LogAnalyticsConfiguration logAnalyticsConfiguration; + + /** + * Get the destination property: Logs destination. + * + * @return the destination value. + */ + public String destination() { + return this.destination; + } + + /** + * Set the destination property: Logs destination. + * + * @param destination the destination value to set. + * @return the AppLogsConfiguration object itself. + */ + public AppLogsConfiguration withDestination(String destination) { + this.destination = destination; + return this; + } + + /** + * Get the logAnalyticsConfiguration property: Log Analytics configuration. + * + * @return the logAnalyticsConfiguration value. + */ + public LogAnalyticsConfiguration logAnalyticsConfiguration() { + return this.logAnalyticsConfiguration; + } + + /** + * Set the logAnalyticsConfiguration property: Log Analytics configuration. + * + * @param logAnalyticsConfiguration the logAnalyticsConfiguration value to set. + * @return the AppLogsConfiguration object itself. + */ + public AppLogsConfiguration withLogAnalyticsConfiguration(LogAnalyticsConfiguration logAnalyticsConfiguration) { + this.logAnalyticsConfiguration = logAnalyticsConfiguration; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (logAnalyticsConfiguration() != null) { + logAnalyticsConfiguration().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppProtocol.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppProtocol.java new file mode 100644 index 0000000000000..41806e7b5dfaf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AppProtocol.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for AppProtocol. */ +public final class AppProtocol extends ExpandableStringEnum { + /** Static value http for AppProtocol. */ + public static final AppProtocol HTTP = fromString("http"); + + /** Static value grpc for AppProtocol. */ + public static final AppProtocol GRPC = fromString("grpc"); + + /** + * Creates or finds a AppProtocol from its string representation. + * + * @param name a name to look for. + * @return the corresponding AppProtocol. + */ + @JsonCreator + public static AppProtocol fromString(String name) { + return fromString(name, AppProtocol.class); + } + + /** @return known AppProtocol values. */ + public static Collection values() { + return values(AppProtocol.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java new file mode 100644 index 0000000000000..d5882c06006e9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AvailableOperations.java @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Available operations of the service. */ +@Fluent +public final class AvailableOperations { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AvailableOperations.class); + + /* + * Collection of available operation details + */ + @JsonProperty(value = "value") + private List value; + + /* + * URL client should use to fetch the next page (per server side paging). + * It's null for now, added for future use. + */ + @JsonProperty(value = "nextLink") + private String nextLink; + + /** + * Get the value property: Collection of available operation details. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Collection of available operation details. + * + * @param value the value value to set. + * @return the AvailableOperations object itself. + */ + public AvailableOperations withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL client should use to fetch the next page (per server side paging). It's null for + * now, added for future use. + * + * @param nextLink the nextLink value to set. + * @return the AvailableOperations object itself. + */ + public AvailableOperations withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureCredentials.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureCredentials.java new file mode 100644 index 0000000000000..c3216f82d50c7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureCredentials.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App credentials. */ +@Fluent +public final class AzureCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureCredentials.class); + + /* + * Client Id. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /* + * Client Secret. + */ + @JsonProperty(value = "clientSecret") + private String clientSecret; + + /* + * Tenant Id. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /* + * Subscription Id. + */ + @JsonProperty(value = "subscriptionId") + private String subscriptionId; + + /** + * Get the clientId property: Client Id. + * + * @return the clientId value. + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the clientId property: Client Id. + * + * @param clientId the clientId value to set. + * @return the AzureCredentials object itself. + */ + public AzureCredentials withClientId(String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get the clientSecret property: Client Secret. + * + * @return the clientSecret value. + */ + public String clientSecret() { + return this.clientSecret; + } + + /** + * Set the clientSecret property: Client Secret. + * + * @param clientSecret the clientSecret value to set. + * @return the AzureCredentials object itself. + */ + public AzureCredentials withClientSecret(String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get the tenantId property: Tenant Id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Tenant Id. + * + * @param tenantId the tenantId value to set. + * @return the AzureCredentials object itself. + */ + public AzureCredentials withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the subscriptionId property: Subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Set the subscriptionId property: Subscription Id. + * + * @param subscriptionId the subscriptionId value to set. + * @return the AzureCredentials object itself. + */ + public AzureCredentials withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureFileProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureFileProperties.java new file mode 100644 index 0000000000000..277ac872fb889 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/AzureFileProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Azure File Properties. */ +@Fluent +public final class AzureFileProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureFileProperties.class); + + /* + * Storage account name for azure file. + */ + @JsonProperty(value = "accountName") + private String accountName; + + /* + * Storage account key for azure file. + */ + @JsonProperty(value = "accountKey") + private String accountKey; + + /* + * Access mode for storage + */ + @JsonProperty(value = "accessMode") + private AccessMode accessMode; + + /* + * Azure file share name. + */ + @JsonProperty(value = "shareName") + private String shareName; + + /** + * Get the accountName property: Storage account name for azure file. + * + * @return the accountName value. + */ + public String accountName() { + return this.accountName; + } + + /** + * Set the accountName property: Storage account name for azure file. + * + * @param accountName the accountName value to set. + * @return the AzureFileProperties object itself. + */ + public AzureFileProperties withAccountName(String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get the accountKey property: Storage account key for azure file. + * + * @return the accountKey value. + */ + public String accountKey() { + return this.accountKey; + } + + /** + * Set the accountKey property: Storage account key for azure file. + * + * @param accountKey the accountKey value to set. + * @return the AzureFileProperties object itself. + */ + public AzureFileProperties withAccountKey(String accountKey) { + this.accountKey = accountKey; + return this; + } + + /** + * Get the accessMode property: Access mode for storage. + * + * @return the accessMode value. + */ + public AccessMode accessMode() { + return this.accessMode; + } + + /** + * Set the accessMode property: Access mode for storage. + * + * @param accessMode the accessMode value to set. + * @return the AzureFileProperties object itself. + */ + public AzureFileProperties withAccessMode(AccessMode accessMode) { + this.accessMode = accessMode; + return this; + } + + /** + * Get the shareName property: Azure file share name. + * + * @return the shareName value. + */ + public String shareName() { + return this.shareName; + } + + /** + * Set the shareName property: Azure file share name. + * + * @param shareName the shareName value to set. + * @return the AzureFileProperties object itself. + */ + public AzureFileProperties withShareName(String shareName) { + this.shareName = shareName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Configuration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Configuration.java new file mode 100644 index 0000000000000..c872aa8808840 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Configuration.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Non versioned Container App configuration properties that define the mutable settings of a Container app. */ +@Fluent +public final class Configuration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Configuration.class); + + /* + * Collection of secrets used by a Container app + */ + @JsonProperty(value = "secrets") + private List secrets; + + /* + * ActiveRevisionsMode controls how active revisions are handled for the + * Container app: + * Multiple: multiple revisions can be active. If no value if + * provided, this is the defaultSingle: Only one revision can + * be active at a time. Revision weights can not be used in this + * mode + */ + @JsonProperty(value = "activeRevisionsMode") + private ActiveRevisionsMode activeRevisionsMode; + + /* + * Ingress configurations. + */ + @JsonProperty(value = "ingress") + private Ingress ingress; + + /* + * Collection of private container registry credentials for containers used + * by the Container app + */ + @JsonProperty(value = "registries") + private List registries; + + /** + * Get the secrets property: Collection of secrets used by a Container app. + * + * @return the secrets value. + */ + public List secrets() { + return this.secrets; + } + + /** + * Set the secrets property: Collection of secrets used by a Container app. + * + * @param secrets the secrets value to set. + * @return the Configuration object itself. + */ + public Configuration withSecrets(List secrets) { + this.secrets = secrets; + return this; + } + + /** + * Get the activeRevisionsMode property: ActiveRevisionsMode controls how active revisions are handled for the + * Container app: <list><item>Multiple: multiple revisions can be active. If no value if provided, this + * is the default</item><item>Single: Only one revision can be active at a time. Revision weights can + * not be used in this mode</item></list>. + * + * @return the activeRevisionsMode value. + */ + public ActiveRevisionsMode activeRevisionsMode() { + return this.activeRevisionsMode; + } + + /** + * Set the activeRevisionsMode property: ActiveRevisionsMode controls how active revisions are handled for the + * Container app: <list><item>Multiple: multiple revisions can be active. If no value if provided, this + * is the default</item><item>Single: Only one revision can be active at a time. Revision weights can + * not be used in this mode</item></list>. + * + * @param activeRevisionsMode the activeRevisionsMode value to set. + * @return the Configuration object itself. + */ + public Configuration withActiveRevisionsMode(ActiveRevisionsMode activeRevisionsMode) { + this.activeRevisionsMode = activeRevisionsMode; + return this; + } + + /** + * Get the ingress property: Ingress configurations. + * + * @return the ingress value. + */ + public Ingress ingress() { + return this.ingress; + } + + /** + * Set the ingress property: Ingress configurations. + * + * @param ingress the ingress value to set. + * @return the Configuration object itself. + */ + public Configuration withIngress(Ingress ingress) { + this.ingress = ingress; + return this; + } + + /** + * Get the registries property: Collection of private container registry credentials for containers used by the + * Container app. + * + * @return the registries value. + */ + public List registries() { + return this.registries; + } + + /** + * Set the registries property: Collection of private container registry credentials for containers used by the + * Container app. + * + * @param registries the registries value to set. + * @return the Configuration object itself. + */ + public Configuration 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 (ingress() != null) { + ingress().validate(); + } + if (registries() != null) { + registries().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Container.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Container.java new file mode 100644 index 0000000000000..f3a75b7e26867 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Container.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.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App container definition. */ +@Fluent +public final class Container { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Container.class); + + /* + * 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; + + /** + * 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 Container object itself. + */ + public Container 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 Container object itself. + */ + public Container 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 Container object itself. + */ + public Container 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 Container object itself. + */ + public Container 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 Container object itself. + */ + public Container 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 Container object itself. + */ + public Container 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/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApp.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApp.java new file mode 100644 index 0000000000000..49956e9cd030d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApp.java @@ -0,0 +1,268 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.Region; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import java.util.Map; + +/** An immutable client-side representation of ContainerApp. */ +public interface ContainerApp { + /** + * 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 provisioningState property: Provisioning state of the Container App. + * + * @return the provisioningState value. + */ + ContainerAppProvisioningState provisioningState(); + + /** + * Gets the managedEnvironmentId property: Resource ID of the Container App's environment. + * + * @return the managedEnvironmentId value. + */ + String managedEnvironmentId(); + + /** + * Gets the latestRevisionName property: Name of the latest revision of the Container App. + * + * @return the latestRevisionName value. + */ + String latestRevisionName(); + + /** + * Gets the latestRevisionFqdn property: Fully Qualified Domain Name of the latest revision of the Container App. + * + * @return the latestRevisionFqdn value. + */ + String latestRevisionFqdn(); + + /** + * Gets the configuration property: Non versioned Container App configuration properties. + * + * @return the configuration value. + */ + Configuration configuration(); + + /** + * Gets the template property: Container App versioned application definition. + * + * @return the template value. + */ + Template template(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ContainerAppInner object. + * + * @return the inner object. + */ + ContainerAppInner innerModel(); + + /** The entirety of the ContainerApp definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ContainerApp definition stages. */ + interface DefinitionStages { + /** The first stage of the ContainerApp definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ContainerApp 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 ContainerApp 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 ContainerApp 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.WithManagedEnvironmentId, + DefinitionStages.WithConfiguration, + DefinitionStages.WithTemplate { + /** + * Executes the create request. + * + * @return the created resource. + */ + ContainerApp create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ContainerApp create(Context context); + } + /** The stage of the ContainerApp 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 ContainerApp definition allowing to specify managedEnvironmentId. */ + interface WithManagedEnvironmentId { + /** + * Specifies the managedEnvironmentId property: Resource ID of the Container App's environment.. + * + * @param managedEnvironmentId Resource ID of the Container App's environment. + * @return the next definition stage. + */ + WithCreate withManagedEnvironmentId(String managedEnvironmentId); + } + /** The stage of the ContainerApp definition allowing to specify configuration. */ + interface WithConfiguration { + /** + * Specifies the configuration property: Non versioned Container App configuration properties.. + * + * @param configuration Non versioned Container App configuration properties. + * @return the next definition stage. + */ + WithCreate withConfiguration(Configuration configuration); + } + /** The stage of the ContainerApp definition allowing to specify template. */ + interface WithTemplate { + /** + * Specifies the template property: Container App versioned application definition.. + * + * @param template Container App versioned application definition. + * @return the next definition stage. + */ + WithCreate withTemplate(Template template); + } + } + /** + * Begins update for the ContainerApp resource. + * + * @return the stage of resource update. + */ + ContainerApp.Update update(); + + /** The template for ContainerApp update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ContainerApp apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ContainerApp apply(Context context); + } + /** The ContainerApp update stages. */ + interface UpdateStages { + /** The stage of the ContainerApp 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. + */ + ContainerApp refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ContainerApp refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppCollection.java new file mode 100644 index 0000000000000..6cc5a7f7e5d31 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.ContainerAppInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App collection ARM resource. */ +@Fluent +public final class ContainerAppCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppCollection.class); + + /* + * 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; + + /** + * 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 ContainerAppCollection object itself. + */ + public ContainerAppCollection 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 ContainerAppCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppPatch.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppPatch.java new file mode 100644 index 0000000000000..f2a3439d8cfc7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppPatch.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.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** Container App Patch. */ +@Fluent +public final class ContainerAppPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerAppPatch.class); + + /* + * 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; + + /** + * 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 ContainerAppPatch object itself. + */ + public ContainerAppPatch 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/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProvisioningState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProvisioningState.java new file mode 100644 index 0000000000000..405f2e5ff2fc2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppProvisioningState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for ContainerAppProvisioningState. */ +public final class ContainerAppProvisioningState extends ExpandableStringEnum { + /** Static value InProgress for ContainerAppProvisioningState. */ + public static final ContainerAppProvisioningState IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for ContainerAppProvisioningState. */ + public static final ContainerAppProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ContainerAppProvisioningState. */ + public static final ContainerAppProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ContainerAppProvisioningState. */ + public static final ContainerAppProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ContainerAppProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ContainerAppProvisioningState. + */ + @JsonCreator + public static ContainerAppProvisioningState fromString(String name) { + return fromString(name, ContainerAppProvisioningState.class); + } + + /** @return known ContainerAppProvisioningState values. */ + public static Collection values() { + return values(ContainerAppProvisioningState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApps.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApps.java new file mode 100644 index 0000000000000..34970b886a8fa --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerApps.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ContainerApps. */ +public interface ContainerApps { + /** + * Get the Container Apps in a given subscription. + * + * @throws com.azure.resourcemanager.app.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 in a given subscription. + */ + PagedIterable list(); + + /** + * Get the Container Apps 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.app.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 in a given subscription. + */ + PagedIterable list(Context context); + + /** + * Get the Container Apps 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.app.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 in a given resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get the Container Apps 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.app.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 in a given resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container App. + */ + ContainerApp getByResourceGroup(String resourceGroupName, String name); + + /** + * Get the properties of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container App along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Container App. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 name); + + /** + * Description for Delete a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name 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.resourcemanager.app.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 name, Context context); + + /** + * Get the properties of a Container App. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container App along with {@link Response}. + */ + ContainerApp getById(String id); + + /** + * Get the properties of a Container App. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the properties of a Container App along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Description for Delete a Container App. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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); + + /** + * Description for Delete a Container App. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 ContainerApp resource. + * + * @param name resource name. + * @return the first stage of the new ContainerApp definition. + */ + ContainerApp.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisionReplicas.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisionReplicas.java new file mode 100644 index 0000000000000..16397f955cd07 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisionReplicas.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ContainerAppsRevisionReplicas. */ +public interface ContainerAppsRevisionReplicas { + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 replica for a Container App Revision. + */ + Replica getReplica(String resourceGroupName, String containerAppName, String revisionName, String name); + + /** + * Get a replica for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param name Name of the Container App Revision Replica. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 replica for a Container App Revision along with {@link Response}. + */ + Response getReplicaWithResponse( + String resourceGroupName, String containerAppName, String revisionName, String name, Context context); + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Revision Replicas collection ARM resource. + */ + ReplicaCollection listReplicas(String resourceGroupName, String containerAppName, String revisionName); + + /** + * List replicas for a Container App Revision. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param revisionName Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Revision Replicas collection ARM resource along with {@link Response}. + */ + Response listReplicasWithResponse( + String resourceGroupName, String containerAppName, String revisionName, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisions.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisions.java new file mode 100644 index 0000000000000..5ddbf62010474 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsRevisions.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ContainerAppsRevisions. */ +public interface ContainerAppsRevisions { + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Revisions for a given Container App. + */ + PagedIterable listRevisions(String resourceGroupName, String containerAppName); + + /** + * Get the Revisions for a given Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App for which Revisions are needed. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Revisions for a given Container App. + */ + PagedIterable listRevisions(String resourceGroupName, String containerAppName, Context context); + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 revision of a Container App. + */ + Revision getRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Get a revision of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 revision of a Container App along with {@link Response}. + */ + Response getRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 activateRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Activates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 activateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 deactivateRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Deactivates a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 deactivateRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 restartRevision(String resourceGroupName, String containerAppName, String name); + + /** + * Restarts a revision for a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App Revision. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 restartRevisionWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsSourceControls.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsSourceControls.java new file mode 100644 index 0000000000000..d684ae82ecc2d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerAppsSourceControls.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ContainerAppsSourceControls. */ +public interface ContainerAppsSourceControls { + /** + * Get the Container App SourceControls in a given resource group. + * + * @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.resourcemanager.app.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 App SourceControls in a given resource group. + */ + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName); + + /** + * Get the Container App SourceControls in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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.resourcemanager.app.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 App SourceControls in a given resource group. + */ + PagedIterable listByContainerApp(String resourceGroupName, String containerAppName, Context context); + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl of a Container App. + */ + SourceControl get(String resourceGroupName, String containerAppName, String name); + + /** + * Get a SourceControl of a Container App. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl of a Container App along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String containerAppName, String name, Context context); + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 containerAppName, String name); + + /** + * Description for Delete a Container App SourceControl. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @param name Name of the Container App SourceControl. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 containerAppName, String name, Context context); + + /** + * Get a SourceControl of a Container App. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl of a Container App along with {@link Response}. + */ + SourceControl getById(String id); + + /** + * Get a SourceControl of a Container App. + * + * @param id the resource ID. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 SourceControl of a Container App along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Description for Delete a Container App SourceControl. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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); + + /** + * Description for Delete a Container App SourceControl. + * + * @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.app.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 SourceControl resource. + * + * @param name resource name. + * @return the first stage of the new SourceControl definition. + */ + SourceControl.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerResources.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerResources.java new file mode 100644 index 0000000000000..898729bc98002 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ContainerResources.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.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container resource requirements. */ +@Fluent +public final class ContainerResources { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ContainerResources.class); + + /* + * Required CPU in cores, e.g. 0.5 + */ + @JsonProperty(value = "cpu") + private Double cpu; + + /* + * Required memory, e.g. "250Mb" + */ + @JsonProperty(value = "memory") + private String memory; + + /** + * Get the cpu property: Required CPU in cores, e.g. 0.5. + * + * @return the cpu value. + */ + public Double cpu() { + return this.cpu; + } + + /** + * Set the cpu property: Required CPU in cores, e.g. 0.5. + * + * @param cpu the cpu value to set. + * @return the ContainerResources object itself. + */ + public ContainerResources withCpu(Double cpu) { + this.cpu = cpu; + return this; + } + + /** + * Get the memory property: Required memory, e.g. "250Mb". + * + * @return the memory value. + */ + public String memory() { + return this.memory; + } + + /** + * Set the memory property: Required memory, e.g. "250Mb". + * + * @param memory the memory value to set. + * @return the ContainerResources object itself. + */ + public ContainerResources withMemory(String memory) { + this.memory = memory; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomScaleRule.java new file mode 100644 index 0000000000000..e31ca37dc5fe6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/CustomScaleRule.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Container App container Custom scaling rule. */ +@Fluent +public final class CustomScaleRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(CustomScaleRule.class); + + /* + * Type of the custom scale rule + * eg: azure-servicebus, redis etc. + */ + @JsonProperty(value = "type") + private String type; + + /* + * Metadata properties to describe custom scale rule. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * Authentication secrets for the custom scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** + * Get the type property: Type of the custom scale rule eg: azure-servicebus, redis etc. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: Type of the custom scale rule eg: azure-servicebus, redis etc. + * + * @param type the type value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withType(String type) { + this.type = type; + return this; + } + + /** + * Get the metadata property: Metadata properties to describe custom scale rule. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata properties to describe custom scale rule. + * + * @param metadata the metadata value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the auth property: Authentication secrets for the custom scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the custom scale rule. + * + * @param auth the auth value to set. + * @return the CustomScaleRule object itself. + */ + public CustomScaleRule withAuth(List auth) { + this.auth = auth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() != null) { + auth().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Dapr.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Dapr.java new file mode 100644 index 0000000000000..2ef96f1c69c19 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Dapr.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Dapr configuration. */ +@Fluent +public final class Dapr { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Dapr.class); + + /* + * Boolean indicating if the Dapr side car is enabled + */ + @JsonProperty(value = "enabled") + private Boolean enabled; + + /* + * Dapr application identifier + */ + @JsonProperty(value = "appId") + private String appId; + + /* + * Tells Dapr which protocol your application is using. Valid options are + * http and grpc. Default is http + */ + @JsonProperty(value = "appProtocol") + private AppProtocol appProtocol; + + /* + * Tells Dapr which port your application is listening on + */ + @JsonProperty(value = "appPort") + private Integer appPort; + + /** + * Get the enabled property: Boolean indicating if the Dapr side car is enabled. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Boolean indicating if the Dapr side car is enabled. + * + * @param enabled the enabled value to set. + * @return the Dapr object itself. + */ + public Dapr withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the appId property: Dapr application identifier. + * + * @return the appId value. + */ + public String appId() { + return this.appId; + } + + /** + * Set the appId property: Dapr application identifier. + * + * @param appId the appId value to set. + * @return the Dapr object itself. + */ + public Dapr withAppId(String appId) { + this.appId = appId; + return this; + } + + /** + * Get the appProtocol property: Tells Dapr which protocol your application is using. Valid options are http and + * grpc. Default is http. + * + * @return the appProtocol value. + */ + public AppProtocol appProtocol() { + return this.appProtocol; + } + + /** + * Set the appProtocol property: Tells Dapr which protocol your application is using. Valid options are http and + * grpc. Default is http. + * + * @param appProtocol the appProtocol value to set. + * @return the Dapr object itself. + */ + public Dapr withAppProtocol(AppProtocol appProtocol) { + this.appProtocol = appProtocol; + return this; + } + + /** + * Get the appPort property: Tells Dapr which port your application is listening on. + * + * @return the appPort value. + */ + public Integer appPort() { + return this.appPort; + } + + /** + * Set the appPort property: Tells Dapr which port your application is listening on. + * + * @param appPort the appPort value to set. + * @return the Dapr object itself. + */ + public Dapr withAppPort(Integer appPort) { + this.appPort = appPort; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseError.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseError.java new file mode 100644 index 0000000000000..1495df5758df0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseError.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** App Service error response. */ +@Immutable +public final class DefaultErrorResponseError extends ManagementError { + @JsonIgnore private final ClientLogger logger = new ClientLogger(DefaultErrorResponseError.class); + + /* + * More information to debug error. + */ + @JsonProperty(value = "innererror", access = JsonProperty.Access.WRITE_ONLY) + private String innererror; + + /** + * Get the innererror property: More information to debug error. + * + * @return the innererror value. + */ + public String getInnererror() { + return this.innererror; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseErrorException.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseErrorException.java new file mode 100644 index 0000000000000..f1b5e9cdef0e9 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/DefaultErrorResponseErrorException.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.app.models; + +import com.azure.core.http.HttpResponse; +import com.azure.core.management.exception.ManagementException; + +/** Exception thrown for an invalid response with DefaultErrorResponseError information. */ +public final class DefaultErrorResponseErrorException extends ManagementException { + /** + * Initializes a new instance of the DefaultErrorResponseErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + */ + public DefaultErrorResponseErrorException(String message, HttpResponse response) { + super(message, response); + } + + /** + * Initializes a new instance of the DefaultErrorResponseErrorException class. + * + * @param message the exception message or the response content if a message is not available. + * @param response the HTTP response. + * @param value the deserialized response value. + */ + public DefaultErrorResponseErrorException(String message, HttpResponse response, DefaultErrorResponseError value) { + super(message, response, value); + } + + @Override + public DefaultErrorResponseError getValue() { + return (DefaultErrorResponseError) super.getValue(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentProvisioningState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentProvisioningState.java new file mode 100644 index 0000000000000..f438babe8ad75 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentProvisioningState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for EnvironmentProvisioningState. */ +public final class EnvironmentProvisioningState extends ExpandableStringEnum { + /** Static value Succeeded for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState CANCELED = fromString("Canceled"); + + /** Static value Waiting for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState WAITING = fromString("Waiting"); + + /** Static value InitializationInProgress for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState INITIALIZATION_IN_PROGRESS = + fromString("InitializationInProgress"); + + /** Static value InfrastructureSetupInProgress for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState INFRASTRUCTURE_SETUP_IN_PROGRESS = + fromString("InfrastructureSetupInProgress"); + + /** Static value InfrastructureSetupComplete for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState INFRASTRUCTURE_SETUP_COMPLETE = + fromString("InfrastructureSetupComplete"); + + /** Static value ScheduledForDelete for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState SCHEDULED_FOR_DELETE = fromString("ScheduledForDelete"); + + /** Static value UpgradeRequested for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState UPGRADE_REQUESTED = fromString("UpgradeRequested"); + + /** Static value UpgradeFailed for EnvironmentProvisioningState. */ + public static final EnvironmentProvisioningState UPGRADE_FAILED = fromString("UpgradeFailed"); + + /** + * Creates or finds a EnvironmentProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding EnvironmentProvisioningState. + */ + @JsonCreator + public static EnvironmentProvisioningState fromString(String name) { + return fromString(name, EnvironmentProvisioningState.class); + } + + /** @return known EnvironmentProvisioningState values. */ + public static Collection values() { + return values(EnvironmentProvisioningState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentVar.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentVar.java new file mode 100644 index 0000000000000..39b20073f4927 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/EnvironmentVar.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container environment variable. */ +@Fluent +public final class EnvironmentVar { + @JsonIgnore private final ClientLogger logger = new ClientLogger(EnvironmentVar.class); + + /* + * Environment variable name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Non-secret environment variable value. + */ + @JsonProperty(value = "value") + private String value; + + /* + * Name of the Container App secret from which to pull the environment + * variable value. + */ + @JsonProperty(value = "secretRef") + private String secretRef; + + /** + * Get the name property: Environment variable name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Environment variable name. + * + * @param name the name value to set. + * @return the EnvironmentVar object itself. + */ + public EnvironmentVar withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Non-secret environment variable value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Non-secret environment variable value. + * + * @param value the value value to set. + * @return the EnvironmentVar object itself. + */ + public EnvironmentVar withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the secretRef property: Name of the Container App secret from which to pull the environment variable 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 environment variable value. + * + * @param secretRef the secretRef value to set. + * @return the EnvironmentVar object itself. + */ + public EnvironmentVar withSecretRef(String secretRef) { + this.secretRef = secretRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GithubActionConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GithubActionConfiguration.java new file mode 100644 index 0000000000000..c8a10bff61f0a --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/GithubActionConfiguration.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration properties that define the mutable settings of a Container App SourceControl. */ +@Fluent +public final class GithubActionConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(GithubActionConfiguration.class); + + /* + * Registry configurations. + */ + @JsonProperty(value = "registryInfo") + private RegistryInfo registryInfo; + + /* + * AzureCredentials configurations. + */ + @JsonProperty(value = "azureCredentials") + private AzureCredentials azureCredentials; + + /* + * Docker file path + */ + @JsonProperty(value = "dockerfilePath") + private String dockerfilePath; + + /* + * Code or Image + */ + @JsonProperty(value = "publishType") + private String publishType; + + /* + * Operation system + */ + @JsonProperty(value = "os") + private String os; + + /* + * Runtime stack + */ + @JsonProperty(value = "runtimeStack") + private String runtimeStack; + + /* + * Runtime Version + */ + @JsonProperty(value = "runtimeVersion") + private String runtimeVersion; + + /** + * Get the registryInfo property: Registry configurations. + * + * @return the registryInfo value. + */ + public RegistryInfo registryInfo() { + return this.registryInfo; + } + + /** + * Set the registryInfo property: Registry configurations. + * + * @param registryInfo the registryInfo value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withRegistryInfo(RegistryInfo registryInfo) { + this.registryInfo = registryInfo; + return this; + } + + /** + * Get the azureCredentials property: AzureCredentials configurations. + * + * @return the azureCredentials value. + */ + public AzureCredentials azureCredentials() { + return this.azureCredentials; + } + + /** + * Set the azureCredentials property: AzureCredentials configurations. + * + * @param azureCredentials the azureCredentials value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withAzureCredentials(AzureCredentials azureCredentials) { + this.azureCredentials = azureCredentials; + return this; + } + + /** + * Get the dockerfilePath property: Docker file path. + * + * @return the dockerfilePath value. + */ + public String dockerfilePath() { + return this.dockerfilePath; + } + + /** + * Set the dockerfilePath property: Docker file path. + * + * @param dockerfilePath the dockerfilePath value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withDockerfilePath(String dockerfilePath) { + this.dockerfilePath = dockerfilePath; + return this; + } + + /** + * Get the publishType property: Code or Image. + * + * @return the publishType value. + */ + public String publishType() { + return this.publishType; + } + + /** + * Set the publishType property: Code or Image. + * + * @param publishType the publishType value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withPublishType(String publishType) { + this.publishType = publishType; + return this; + } + + /** + * Get the os property: Operation system. + * + * @return the os value. + */ + public String os() { + return this.os; + } + + /** + * Set the os property: Operation system. + * + * @param os the os value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withOs(String os) { + this.os = os; + return this; + } + + /** + * Get the runtimeStack property: Runtime stack. + * + * @return the runtimeStack value. + */ + public String runtimeStack() { + return this.runtimeStack; + } + + /** + * Set the runtimeStack property: Runtime stack. + * + * @param runtimeStack the runtimeStack value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withRuntimeStack(String runtimeStack) { + this.runtimeStack = runtimeStack; + return this; + } + + /** + * Get the runtimeVersion property: Runtime Version. + * + * @return the runtimeVersion value. + */ + public String runtimeVersion() { + return this.runtimeVersion; + } + + /** + * Set the runtimeVersion property: Runtime Version. + * + * @param runtimeVersion the runtimeVersion value to set. + * @return the GithubActionConfiguration object itself. + */ + public GithubActionConfiguration withRuntimeVersion(String runtimeVersion) { + this.runtimeVersion = runtimeVersion; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (registryInfo() != null) { + registryInfo().validate(); + } + if (azureCredentials() != null) { + azureCredentials().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpScaleRule.java new file mode 100644 index 0000000000000..3fff401b91f8f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/HttpScaleRule.java @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; +import java.util.Map; + +/** Container App container Custom scaling rule. */ +@Fluent +public final class HttpScaleRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(HttpScaleRule.class); + + /* + * Metadata properties to describe http scale rule. + */ + @JsonProperty(value = "metadata") + @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) + private Map metadata; + + /* + * Authentication secrets for the custom scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** + * Get the metadata property: Metadata properties to describe http scale rule. + * + * @return the metadata value. + */ + public Map metadata() { + return this.metadata; + } + + /** + * Set the metadata property: Metadata properties to describe http scale rule. + * + * @param metadata the metadata value to set. + * @return the HttpScaleRule object itself. + */ + public HttpScaleRule withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Get the auth property: Authentication secrets for the custom scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the custom scale rule. + * + * @param auth the auth value to set. + * @return the HttpScaleRule object itself. + */ + public HttpScaleRule withAuth(List auth) { + this.auth = auth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() != null) { + auth().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Ingress.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Ingress.java new file mode 100644 index 0000000000000..beaf84a124beb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Ingress.java @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Ingress configuration. */ +@Fluent +public final class Ingress { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Ingress.class); + + /* + * Hostname. + */ + @JsonProperty(value = "fqdn", access = JsonProperty.Access.WRITE_ONLY) + private String fqdn; + + /* + * Bool indicating if app exposes an external http endpoint + */ + @JsonProperty(value = "external") + private Boolean external; + + /* + * Target Port in containers for traffic from ingress + */ + @JsonProperty(value = "targetPort") + private Integer targetPort; + + /* + * Ingress transport protocol + */ + @JsonProperty(value = "transport") + private IngressTransportMethod transport; + + /* + * Traffic weights for app's revisions + */ + @JsonProperty(value = "traffic") + private List traffic; + + /* + * Bool indicating if HTTP connections to is allowed. If set to false HTTP + * connections are automatically redirected to HTTPS connections + */ + @JsonProperty(value = "allowInsecure") + private Boolean allowInsecure; + + /** + * Get the fqdn property: Hostname. + * + * @return the fqdn value. + */ + public String fqdn() { + return this.fqdn; + } + + /** + * Get the external property: Bool indicating if app exposes an external http endpoint. + * + * @return the external value. + */ + public Boolean external() { + return this.external; + } + + /** + * Set the external property: Bool indicating if app exposes an external http endpoint. + * + * @param external the external value to set. + * @return the Ingress object itself. + */ + public Ingress withExternal(Boolean external) { + this.external = external; + return this; + } + + /** + * Get the targetPort property: Target Port in containers for traffic from ingress. + * + * @return the targetPort value. + */ + public Integer targetPort() { + return this.targetPort; + } + + /** + * Set the targetPort property: Target Port in containers for traffic from ingress. + * + * @param targetPort the targetPort value to set. + * @return the Ingress object itself. + */ + public Ingress withTargetPort(Integer targetPort) { + this.targetPort = targetPort; + return this; + } + + /** + * Get the transport property: Ingress transport protocol. + * + * @return the transport value. + */ + public IngressTransportMethod transport() { + return this.transport; + } + + /** + * Set the transport property: Ingress transport protocol. + * + * @param transport the transport value to set. + * @return the Ingress object itself. + */ + public Ingress withTransport(IngressTransportMethod transport) { + this.transport = transport; + return this; + } + + /** + * Get the traffic property: Traffic weights for app's revisions. + * + * @return the traffic value. + */ + public List traffic() { + return this.traffic; + } + + /** + * Set the traffic property: Traffic weights for app's revisions. + * + * @param traffic the traffic value to set. + * @return the Ingress object itself. + */ + public Ingress withTraffic(List traffic) { + this.traffic = traffic; + return this; + } + + /** + * Get the allowInsecure property: Bool indicating if HTTP connections to is allowed. If set to false HTTP + * connections are automatically redirected to HTTPS connections. + * + * @return the allowInsecure value. + */ + public Boolean allowInsecure() { + return this.allowInsecure; + } + + /** + * Set the allowInsecure property: Bool indicating if HTTP connections to is allowed. If set to false HTTP + * connections are automatically redirected to HTTPS connections. + * + * @param allowInsecure the allowInsecure value to set. + * @return the Ingress object itself. + */ + public Ingress withAllowInsecure(Boolean allowInsecure) { + this.allowInsecure = allowInsecure; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (traffic() != null) { + traffic().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IngressTransportMethod.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IngressTransportMethod.java new file mode 100644 index 0000000000000..47af653dcf443 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/IngressTransportMethod.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.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for IngressTransportMethod. */ +public final class IngressTransportMethod extends ExpandableStringEnum { + /** Static value auto for IngressTransportMethod. */ + public static final IngressTransportMethod AUTO = fromString("auto"); + + /** Static value http for IngressTransportMethod. */ + public static final IngressTransportMethod HTTP = fromString("http"); + + /** Static value http2 for IngressTransportMethod. */ + public static final IngressTransportMethod HTTP2 = fromString("http2"); + + /** + * Creates or finds a IngressTransportMethod from its string representation. + * + * @param name a name to look for. + * @return the corresponding IngressTransportMethod. + */ + @JsonCreator + public static IngressTransportMethod fromString(String name) { + return fromString(name, IngressTransportMethod.class); + } + + /** @return known IngressTransportMethod values. */ + public static Collection values() { + return values(IngressTransportMethod.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.java new file mode 100644 index 0000000000000..f4a37bbf289a8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/LogAnalyticsConfiguration.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.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Log analytics configuration. */ +@Fluent +public final class LogAnalyticsConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(LogAnalyticsConfiguration.class); + + /* + * Log analytics customer id + */ + @JsonProperty(value = "customerId") + private String customerId; + + /* + * Log analytics customer key + */ + @JsonProperty(value = "sharedKey") + private String sharedKey; + + /** + * Get the customerId property: Log analytics customer id. + * + * @return the customerId value. + */ + public String customerId() { + return this.customerId; + } + + /** + * Set the customerId property: Log analytics customer id. + * + * @param customerId the customerId value to set. + * @return the LogAnalyticsConfiguration object itself. + */ + public LogAnalyticsConfiguration withCustomerId(String customerId) { + this.customerId = customerId; + return this; + } + + /** + * Get the sharedKey property: Log analytics customer key. + * + * @return the sharedKey value. + */ + public String sharedKey() { + return this.sharedKey; + } + + /** + * Set the sharedKey property: Log analytics customer key. + * + * @param sharedKey the sharedKey value to set. + * @return the LogAnalyticsConfiguration object itself. + */ + public LogAnalyticsConfiguration withSharedKey(String sharedKey) { + this.sharedKey = sharedKey; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironment.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironment.java new file mode 100644 index 0000000000000..c5cb440da2891 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironment.java @@ -0,0 +1,307 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.Region; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import java.util.Map; + +/** An immutable client-side representation of ManagedEnvironment. */ +public interface ManagedEnvironment { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + String location(); + + /** + * Gets the tags property: Resource tags. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the provisioningState property: Provisioning state of the Environment. + * + * @return the provisioningState value. + */ + EnvironmentProvisioningState provisioningState(); + + /** + * Gets the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * + * @return the daprAIInstrumentationKey value. + */ + String daprAIInstrumentationKey(); + + /** + * Gets the vnetConfiguration property: Vnet configuration for the environment. + * + * @return the vnetConfiguration value. + */ + VnetConfiguration vnetConfiguration(); + + /** + * Gets the deploymentErrors property: Any errors that occurred during deployment or deployment validation. + * + * @return the deploymentErrors value. + */ + String deploymentErrors(); + + /** + * Gets the internalLoadBalancerEnabled property: Only visible within Vnet/Subnet. + * + * @return the internalLoadBalancerEnabled value. + */ + Boolean internalLoadBalancerEnabled(); + + /** + * Gets the defaultDomain property: Default Domain Name for the cluster. + * + * @return the defaultDomain value. + */ + String defaultDomain(); + + /** + * Gets the staticIp property: Static IP of the Environment. + * + * @return the staticIp value. + */ + String staticIp(); + + /** + * Gets the appLogsConfiguration property: Cluster configuration which enables the log daemon to export app logs to + * a destination. Currently only "log-analytics" is supported. + * + * @return the appLogsConfiguration value. + */ + AppLogsConfiguration appLogsConfiguration(); + + /** + * Gets the region of the resource. + * + * @return the region of the resource. + */ + Region region(); + + /** + * Gets the name of the resource region. + * + * @return the name of the resource region. + */ + String regionName(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner object. + * + * @return the inner object. + */ + ManagedEnvironmentInner innerModel(); + + /** The entirety of the ManagedEnvironment definition. */ + interface Definition + extends DefinitionStages.Blank, + DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, + DefinitionStages.WithCreate { + } + /** The ManagedEnvironment definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedEnvironment definition. */ + interface Blank extends WithLocation { + } + /** The stage of the ManagedEnvironment 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 ManagedEnvironment 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 ManagedEnvironment 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.WithDaprAIInstrumentationKey, + DefinitionStages.WithVnetConfiguration, + DefinitionStages.WithInternalLoadBalancerEnabled, + DefinitionStages.WithAppLogsConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedEnvironment create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedEnvironment create(Context context); + } + /** The stage of the ManagedEnvironment 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 ManagedEnvironment definition allowing to specify daprAIInstrumentationKey. */ + interface WithDaprAIInstrumentationKey { + /** + * Specifies the daprAIInstrumentationKey property: Azure Monitor instrumentation key used by Dapr to export + * Service to Service communication telemetry. + * + * @param daprAIInstrumentationKey Azure Monitor instrumentation key used by Dapr to export Service to + * Service communication telemetry. + * @return the next definition stage. + */ + WithCreate withDaprAIInstrumentationKey(String daprAIInstrumentationKey); + } + /** The stage of the ManagedEnvironment definition allowing to specify vnetConfiguration. */ + interface WithVnetConfiguration { + /** + * Specifies the vnetConfiguration property: Vnet configuration for the environment. + * + * @param vnetConfiguration Vnet configuration for the environment. + * @return the next definition stage. + */ + WithCreate withVnetConfiguration(VnetConfiguration vnetConfiguration); + } + /** The stage of the ManagedEnvironment definition allowing to specify internalLoadBalancerEnabled. */ + interface WithInternalLoadBalancerEnabled { + /** + * Specifies the internalLoadBalancerEnabled property: Only visible within Vnet/Subnet. + * + * @param internalLoadBalancerEnabled Only visible within Vnet/Subnet. + * @return the next definition stage. + */ + WithCreate withInternalLoadBalancerEnabled(Boolean internalLoadBalancerEnabled); + } + /** The stage of the ManagedEnvironment definition allowing to specify appLogsConfiguration. */ + interface WithAppLogsConfiguration { + /** + * Specifies the appLogsConfiguration property: Cluster configuration which enables the log daemon to export + * app logs to a destination. Currently only "log-analytics" is supported. + * + * @param appLogsConfiguration Cluster configuration which enables the log daemon to export app logs to a + * destination. Currently only "log-analytics" is supported. + * @return the next definition stage. + */ + WithCreate withAppLogsConfiguration(AppLogsConfiguration appLogsConfiguration); + } + } + /** + * Begins update for the ManagedEnvironment resource. + * + * @return the stage of resource update. + */ + ManagedEnvironment.Update update(); + + /** The template for ManagedEnvironment update. */ + interface Update extends UpdateStages.WithTags { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedEnvironment apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedEnvironment apply(Context context); + } + /** The ManagedEnvironment update stages. */ + interface UpdateStages { + /** The stage of the ManagedEnvironment 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. + */ + ManagedEnvironment refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedEnvironment refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentPatch.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentPatch.java new file mode 100644 index 0000000000000..261b7e322c01f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentPatch.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.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.Map; + +/** An environment for hosting container apps. */ +@Fluent +public final class ManagedEnvironmentPatch { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentPatch.class); + + /* + * 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; + + /** + * 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 ManagedEnvironmentPatch object itself. + */ + public ManagedEnvironmentPatch 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/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorage.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorage.java new file mode 100644 index 0000000000000..c5e3375dc09c8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorage.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner; + +/** An immutable client-side representation of ManagedEnvironmentStorage. */ +public interface ManagedEnvironmentStorage { + /** + * Gets the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + String id(); + + /** + * Gets the name property: The name of the resource. + * + * @return the name value. + */ + String name(); + + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the properties property: Storage properties. + * + * @return the properties value. + */ + ManagedEnvironmentStorageProperties properties(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStorageInner object. + * + * @return the inner object. + */ + ManagedEnvironmentStorageInner innerModel(); + + /** The entirety of the ManagedEnvironmentStorage definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The ManagedEnvironmentStorage definition stages. */ + interface DefinitionStages { + /** The first stage of the ManagedEnvironmentStorage definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the ManagedEnvironmentStorage definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, envName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @return the next definition stage. + */ + WithCreate withExistingManagedEnvironment(String resourceGroupName, String envName); + } + /** + * The stage of the ManagedEnvironmentStorage definition which contains all the minimum required properties for + * the resource to be created, but also allows for any other optional properties to be specified. + */ + interface WithCreate extends DefinitionStages.WithProperties { + /** + * Executes the create request. + * + * @return the created resource. + */ + ManagedEnvironmentStorage create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + ManagedEnvironmentStorage create(Context context); + } + /** The stage of the ManagedEnvironmentStorage definition allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Storage properties. + * + * @param properties Storage properties. + * @return the next definition stage. + */ + WithCreate withProperties(ManagedEnvironmentStorageProperties properties); + } + } + /** + * Begins update for the ManagedEnvironmentStorage resource. + * + * @return the stage of resource update. + */ + ManagedEnvironmentStorage.Update update(); + + /** The template for ManagedEnvironmentStorage update. */ + interface Update extends UpdateStages.WithProperties { + /** + * Executes the update request. + * + * @return the updated resource. + */ + ManagedEnvironmentStorage apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + ManagedEnvironmentStorage apply(Context context); + } + /** The ManagedEnvironmentStorage update stages. */ + interface UpdateStages { + /** The stage of the ManagedEnvironmentStorage update allowing to specify properties. */ + interface WithProperties { + /** + * Specifies the properties property: Storage properties. + * + * @param properties Storage properties. + * @return the next definition stage. + */ + Update withProperties(ManagedEnvironmentStorageProperties properties); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + ManagedEnvironmentStorage refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + ManagedEnvironmentStorage refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorageProperties.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorageProperties.java new file mode 100644 index 0000000000000..a37ec3af6dbd0 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStorageProperties.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.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Storage properties. */ +@Fluent +public final class ManagedEnvironmentStorageProperties { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentStorageProperties.class); + + /* + * Azure file properties + */ + @JsonProperty(value = "azureFile") + private AzureFileProperties azureFile; + + /** + * Get the azureFile property: Azure file properties. + * + * @return the azureFile value. + */ + public AzureFileProperties azureFile() { + return this.azureFile; + } + + /** + * Set the azureFile property: Azure file properties. + * + * @param azureFile the azureFile value to set. + * @return the ManagedEnvironmentStorageProperties object itself. + */ + public ManagedEnvironmentStorageProperties withAzureFile(AzureFileProperties azureFile) { + this.azureFile = azureFile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureFile() != null) { + azureFile().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStoragesCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStoragesCollection.java new file mode 100644 index 0000000000000..0dab5d4666fb6 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentStoragesCollection.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.app.models; + +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner; +import java.util.List; + +/** An immutable client-side representation of ManagedEnvironmentStoragesCollection. */ +public interface ManagedEnvironmentStoragesCollection { + /** + * Gets the value property: Collection of storage resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentStoragesCollectionInner object. + * + * @return the inner object. + */ + ManagedEnvironmentStoragesCollectionInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironments.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironments.java new file mode 100644 index 0000000000000..e9116a18a9146 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironments.java @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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 ManagedEnvironments. */ +public interface ManagedEnvironments { + /** + * Get all Managed Environments for a subscription. + * + * @throws com.azure.resourcemanager.app.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 Managed Environments for a subscription. + */ + PagedIterable list(); + + /** + * Get all Managed Environments for a subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environments for a subscription. + */ + PagedIterable list(Context context); + + /** + * Get all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 the Managed Environments in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Get all the Managed Environments in a resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 the Managed Environments in a resource group. + */ + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environment used to host container apps. + */ + ManagedEnvironment getByResourceGroup(String resourceGroupName, String name); + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environment used to host container apps along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String name, Context context); + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 name); + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param name Name of the Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 name, Context context); + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environment used to host container apps along with {@link Response}. + */ + ManagedEnvironment getById(String id); + + /** + * Get the properties of a Managed Environment used to host container apps. + * + * @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.app.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 Managed Environment used to host container apps along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete a Managed Environment if it does not have any container apps. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 Managed Environment if it does not have any container apps. + * + * @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.app.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 ManagedEnvironment resource. + * + * @param name resource name. + * @return the first stage of the new ManagedEnvironment definition. + */ + ManagedEnvironment.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsCollection.java new file mode 100644 index 0000000000000..217fdecba4f8d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsCollection.java @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.ManagedEnvironmentInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Collection of Environments. */ +@Fluent +public final class ManagedEnvironmentsCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ManagedEnvironmentsCollection.class); + + /* + * 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; + + /** + * 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 ManagedEnvironmentsCollection object itself. + */ + public ManagedEnvironmentsCollection 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 ManagedEnvironmentsCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsStorages.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsStorages.java new file mode 100644 index 0000000000000..d4510b97bcca8 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ManagedEnvironmentsStorages.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; + +/** Resource collection API of ManagedEnvironmentsStorages. */ +public interface ManagedEnvironmentsStorages { + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 collection of Storage for Environments. + */ + ManagedEnvironmentStoragesCollection list(String resourceGroupName, String envName); + + /** + * GGet all storages for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 collection of Storage for Environments along with {@link Response}. + */ + Response listWithResponse( + String resourceGroupName, String envName, Context context); + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage for a managedEnvironment. + */ + ManagedEnvironmentStorage get(String resourceGroupName, String envName, String name); + + /** + * Get storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage for a managedEnvironment along with {@link Response}. + */ + Response getWithResponse( + String resourceGroupName, String envName, String name, Context context); + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 envName, String name); + + /** + * Delete storage for a managedEnvironment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param envName Name of the Environment. + * @param name Name of the storage. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 envName, String name, Context context); + + /** + * Get storage for a managedEnvironment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage for a managedEnvironment along with {@link Response}. + */ + ManagedEnvironmentStorage getById(String id); + + /** + * Get storage for a managedEnvironment. + * + * @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.app.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 storage for a managedEnvironment along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Delete storage for a managedEnvironment. + * + * @param id the resource ID. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 storage for a managedEnvironment. + * + * @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.app.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 ManagedEnvironmentStorage resource. + * + * @param name resource name. + * @return the first stage of the new ManagedEnvironmentStorage definition. + */ + ManagedEnvironmentStorage.DefinitionStages.Blank define(String name); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDetail.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDetail.java new file mode 100644 index 0000000000000..a2ef9d4853feb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDetail.java @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.resourcemanager.app.fluent.models.OperationDetailInner; + +/** An immutable client-side representation of OperationDetail. */ +public interface OperationDetail { + /** + * Gets the name property: Name of the operation. + * + * @return the name value. + */ + String name(); + + /** + * Gets the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + Boolean isDataAction(); + + /** + * Gets the display property: Display of the operation. + * + * @return the display value. + */ + OperationDisplay display(); + + /** + * Gets the origin property: Origin of the operation. + * + * @return the origin value. + */ + String origin(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.OperationDetailInner object. + * + * @return the inner object. + */ + OperationDetailInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDisplay.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDisplay.java new file mode 100644 index 0000000000000..772d1141355c5 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/OperationDisplay.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Operation display payload. */ +@Fluent +public final class OperationDisplay { + @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationDisplay.class); + + /* + * Resource provider of the operation + */ + @JsonProperty(value = "provider") + private String provider; + + /* + * Resource of the operation + */ + @JsonProperty(value = "resource") + private String resource; + + /* + * Localized friendly name for the operation + */ + @JsonProperty(value = "operation") + private String operation; + + /* + * Localized friendly description for the operation + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the provider property: Resource provider of the operation. + * + * @return the provider value. + */ + public String provider() { + return this.provider; + } + + /** + * Set the provider property: Resource provider of the operation. + * + * @param provider the provider value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource property: Resource of the operation. + * + * @return the resource value. + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource property: Resource of the operation. + * + * @param resource the resource value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation property: Localized friendly name for the operation. + * + * @return the operation value. + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation property: Localized friendly name for the operation. + * + * @param operation the operation value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description property: Localized friendly description for the operation. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Localized friendly description for the operation. + * + * @param description the description value to set. + * @return the OperationDisplay object itself. + */ + public OperationDisplay withDescription(String description) { + this.description = description; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Operations.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Operations.java new file mode 100644 index 0000000000000..d84cbfd7cae42 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Operations.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.app.models; + +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; + +/** Resource collection API of Operations. */ +public interface Operations { + /** + * Lists all of the available RP operations. + * + * @throws com.azure.resourcemanager.app.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 available operations of the service. + */ + PagedIterable list(); + + /** + * Lists all of the available RP operations. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.resourcemanager.app.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 available operations of the service. + */ + PagedIterable list(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.java new file mode 100644 index 0000000000000..c8bfb8807bb82 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/QueueScaleRule.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App container Azure Queue based scaling rule. */ +@Fluent +public final class QueueScaleRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(QueueScaleRule.class); + + /* + * Queue name. + */ + @JsonProperty(value = "queueName") + private String queueName; + + /* + * Queue length. + */ + @JsonProperty(value = "queueLength") + private Integer queueLength; + + /* + * Authentication secrets for the queue scale rule. + */ + @JsonProperty(value = "auth") + private List auth; + + /** + * Get the queueName property: Queue name. + * + * @return the queueName value. + */ + public String queueName() { + return this.queueName; + } + + /** + * Set the queueName property: Queue name. + * + * @param queueName the queueName value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withQueueName(String queueName) { + this.queueName = queueName; + return this; + } + + /** + * Get the queueLength property: Queue length. + * + * @return the queueLength value. + */ + public Integer queueLength() { + return this.queueLength; + } + + /** + * Set the queueLength property: Queue length. + * + * @param queueLength the queueLength value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withQueueLength(Integer queueLength) { + this.queueLength = queueLength; + return this; + } + + /** + * Get the auth property: Authentication secrets for the queue scale rule. + * + * @return the auth value. + */ + public List auth() { + return this.auth; + } + + /** + * Set the auth property: Authentication secrets for the queue scale rule. + * + * @param auth the auth value to set. + * @return the QueueScaleRule object itself. + */ + public QueueScaleRule withAuth(List auth) { + this.auth = auth; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (auth() != null) { + auth().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryCredentials.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryCredentials.java new file mode 100644 index 0000000000000..98c9456d6cc65 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryCredentials.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Private Registry. */ +@Fluent +public final class RegistryCredentials { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryCredentials.class); + + /* + * Container Registry Server + */ + @JsonProperty(value = "server") + private String server; + + /* + * Container Registry Username + */ + @JsonProperty(value = "username") + private String username; + + /* + * The name of the Secret that contains the registry login password + */ + @JsonProperty(value = "passwordSecretRef") + private String passwordSecretRef; + + /** + * Get the server property: Container Registry Server. + * + * @return the server value. + */ + public String server() { + return this.server; + } + + /** + * Set the server property: Container Registry Server. + * + * @param server the server value to set. + * @return the RegistryCredentials object itself. + */ + public RegistryCredentials withServer(String server) { + this.server = server; + return this; + } + + /** + * Get the username property: Container Registry Username. + * + * @return the username value. + */ + public String username() { + return this.username; + } + + /** + * Set the username property: Container Registry Username. + * + * @param username the username value to set. + * @return the RegistryCredentials object itself. + */ + public RegistryCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the passwordSecretRef property: The name of the Secret that contains the registry login password. + * + * @return the passwordSecretRef value. + */ + public String passwordSecretRef() { + return this.passwordSecretRef; + } + + /** + * Set the passwordSecretRef property: The name of the Secret that contains the registry login password. + * + * @param passwordSecretRef the passwordSecretRef value to set. + * @return the RegistryCredentials object itself. + */ + public RegistryCredentials withPasswordSecretRef(String passwordSecretRef) { + this.passwordSecretRef = passwordSecretRef; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryInfo.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryInfo.java new file mode 100644 index 0000000000000..ae98388a9bcf3 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RegistryInfo.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App registry information. */ +@Fluent +public final class RegistryInfo { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RegistryInfo.class); + + /* + * registry server Url. + */ + @JsonProperty(value = "registryUrl") + private String registryUrl; + + /* + * registry username. + */ + @JsonProperty(value = "registryUserName") + private String registryUsername; + + /* + * registry secret. + */ + @JsonProperty(value = "registryPassword") + private String registryPassword; + + /** + * Get the registryUrl property: registry server Url. + * + * @return the registryUrl value. + */ + public String registryUrl() { + return this.registryUrl; + } + + /** + * Set the registryUrl property: registry server Url. + * + * @param registryUrl the registryUrl value to set. + * @return the RegistryInfo object itself. + */ + public RegistryInfo withRegistryUrl(String registryUrl) { + this.registryUrl = registryUrl; + return this; + } + + /** + * Get the registryUsername property: registry username. + * + * @return the registryUsername value. + */ + public String registryUsername() { + return this.registryUsername; + } + + /** + * Set the registryUsername property: registry username. + * + * @param registryUsername the registryUsername value to set. + * @return the RegistryInfo object itself. + */ + public RegistryInfo withRegistryUsername(String registryUsername) { + this.registryUsername = registryUsername; + return this; + } + + /** + * Get the registryPassword property: registry secret. + * + * @return the registryPassword value. + */ + public String registryPassword() { + return this.registryPassword; + } + + /** + * Set the registryPassword property: registry secret. + * + * @param registryPassword the registryPassword value to set. + * @return the RegistryInfo object itself. + */ + public RegistryInfo withRegistryPassword(String registryPassword) { + this.registryPassword = registryPassword; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Replica.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Replica.java new file mode 100644 index 0000000000000..854afb30875cd --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Replica.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.app.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.app.fluent.models.ReplicaInner; +import java.time.OffsetDateTime; +import java.util.List; + +/** An immutable client-side representation of Replica. */ +public interface Replica { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the createdTime property: Timestamp describing when the pod was created by controller. + * + * @return the createdTime value. + */ + OffsetDateTime createdTime(); + + /** + * Gets the containers property: The containers collection under a replica. + * + * @return the containers value. + */ + List containers(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ReplicaInner object. + * + * @return the inner object. + */ + ReplicaInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaCollection.java new file mode 100644 index 0000000000000..e0c08ed7a5a45 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaCollection.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.app.models; + +import com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner; +import java.util.List; + +/** An immutable client-side representation of ReplicaCollection. */ +public interface ReplicaCollection { + /** + * Gets the value property: Collection of resources. + * + * @return the value value. + */ + List value(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.ReplicaCollectionInner object. + * + * @return the inner object. + */ + ReplicaCollectionInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaContainer.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaContainer.java new file mode 100644 index 0000000000000..3beb2955eaa71 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ReplicaContainer.java @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container object under Container App Revision Replica. */ +@Fluent +public final class ReplicaContainer { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ReplicaContainer.class); + + /* + * The Name of the Container + */ + @JsonProperty(value = "name") + private String name; + + /* + * The Id of the Container + */ + @JsonProperty(value = "containerId") + private String containerId; + + /* + * The container ready status + */ + @JsonProperty(value = "ready") + private Boolean ready; + + /* + * The container start status + */ + @JsonProperty(value = "started") + private Boolean started; + + /* + * The container restart count + */ + @JsonProperty(value = "restartCount") + private Integer restartCount; + + /** + * Get the name property: The Name of the Container. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: The Name of the Container. + * + * @param name the name value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withName(String name) { + this.name = name; + return this; + } + + /** + * Get the containerId property: The Id of the Container. + * + * @return the containerId value. + */ + public String containerId() { + return this.containerId; + } + + /** + * Set the containerId property: The Id of the Container. + * + * @param containerId the containerId value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withContainerId(String containerId) { + this.containerId = containerId; + return this; + } + + /** + * Get the ready property: The container ready status. + * + * @return the ready value. + */ + public Boolean ready() { + return this.ready; + } + + /** + * Set the ready property: The container ready status. + * + * @param ready the ready value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withReady(Boolean ready) { + this.ready = ready; + return this; + } + + /** + * Get the started property: The container start status. + * + * @return the started value. + */ + public Boolean started() { + return this.started; + } + + /** + * Set the started property: The container start status. + * + * @param started the started value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withStarted(Boolean started) { + this.started = started; + return this; + } + + /** + * Get the restartCount property: The container restart count. + * + * @return the restartCount value. + */ + public Integer restartCount() { + return this.restartCount; + } + + /** + * Set the restartCount property: The container restart count. + * + * @param restartCount the restartCount value to set. + * @return the ReplicaContainer object itself. + */ + public ReplicaContainer withRestartCount(Integer restartCount) { + this.restartCount = restartCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Revision.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Revision.java new file mode 100644 index 0000000000000..507ea30677540 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Revision.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import java.time.OffsetDateTime; + +/** An immutable client-side representation of Revision. */ +public interface Revision { + /** + * 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 createdTime property: Timestamp describing when the revision was created by controller. + * + * @return the createdTime value. + */ + OffsetDateTime createdTime(); + + /** + * Gets the fqdn property: Fully qualified domain name of the revision. + * + * @return the fqdn value. + */ + String fqdn(); + + /** + * Gets the template property: Container App Revision Template with all possible settings and the defaults if user + * did not provide them. The defaults are populated as they were at the creation time. + * + * @return the template value. + */ + Template template(); + + /** + * Gets the active property: Boolean describing if the Revision is Active. + * + * @return the active value. + */ + Boolean active(); + + /** + * Gets the replicas property: Number of pods currently running for this revision. + * + * @return the replicas value. + */ + Integer replicas(); + + /** + * Gets the trafficWeight property: Traffic weight assigned to this revision. + * + * @return the trafficWeight value. + */ + Integer trafficWeight(); + + /** + * Gets the provisioningError property: Optional Field - Platform Error Message. + * + * @return the provisioningError value. + */ + String provisioningError(); + + /** + * Gets the healthState property: Current health State of the revision. + * + * @return the healthState value. + */ + RevisionHealthState healthState(); + + /** + * Gets the provisioningState property: Current provisioning State of the revision. + * + * @return the provisioningState value. + */ + RevisionProvisioningState provisioningState(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.RevisionInner object. + * + * @return the inner object. + */ + RevisionInner innerModel(); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionCollection.java new file mode 100644 index 0000000000000..0fed9e20e8e66 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.RevisionInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App Revisions collection ARM resource. */ +@Fluent +public final class RevisionCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(RevisionCollection.class); + + /* + * 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; + + /** + * 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 RevisionCollection object itself. + */ + public RevisionCollection 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 RevisionCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionHealthState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionHealthState.java new file mode 100644 index 0000000000000..ec82caa877b10 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionHealthState.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.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RevisionHealthState. */ +public final class RevisionHealthState extends ExpandableStringEnum { + /** Static value Healthy for RevisionHealthState. */ + public static final RevisionHealthState HEALTHY = fromString("Healthy"); + + /** Static value Unhealthy for RevisionHealthState. */ + public static final RevisionHealthState UNHEALTHY = fromString("Unhealthy"); + + /** Static value None for RevisionHealthState. */ + public static final RevisionHealthState NONE = fromString("None"); + + /** + * Creates or finds a RevisionHealthState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RevisionHealthState. + */ + @JsonCreator + public static RevisionHealthState fromString(String name) { + return fromString(name, RevisionHealthState.class); + } + + /** @return known RevisionHealthState values. */ + public static Collection values() { + return values(RevisionHealthState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionProvisioningState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionProvisioningState.java new file mode 100644 index 0000000000000..6438685785062 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/RevisionProvisioningState.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for RevisionProvisioningState. */ +public final class RevisionProvisioningState extends ExpandableStringEnum { + /** Static value Provisioning for RevisionProvisioningState. */ + public static final RevisionProvisioningState PROVISIONING = fromString("Provisioning"); + + /** Static value Provisioned for RevisionProvisioningState. */ + public static final RevisionProvisioningState PROVISIONED = fromString("Provisioned"); + + /** Static value Failed for RevisionProvisioningState. */ + public static final RevisionProvisioningState FAILED = fromString("Failed"); + + /** Static value Deprovisioning for RevisionProvisioningState. */ + public static final RevisionProvisioningState DEPROVISIONING = fromString("Deprovisioning"); + + /** Static value Deprovisioned for RevisionProvisioningState. */ + public static final RevisionProvisioningState DEPROVISIONED = fromString("Deprovisioned"); + + /** + * Creates or finds a RevisionProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding RevisionProvisioningState. + */ + @JsonCreator + public static RevisionProvisioningState fromString(String name) { + return fromString(name, RevisionProvisioningState.class); + } + + /** @return known RevisionProvisioningState values. */ + public static Collection values() { + return values(RevisionProvisioningState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Scale.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Scale.java new file mode 100644 index 0000000000000..ad319ce240a95 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Scale.java @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** Container App scaling configurations. */ +@Fluent +public final class Scale { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Scale.class); + + /* + * Optional. Minimum number of container replicas. + */ + @JsonProperty(value = "minReplicas") + private Integer minReplicas; + + /* + * Optional. Maximum number of container replicas. Defaults to 10 if not + * set. + */ + @JsonProperty(value = "maxReplicas") + private Integer maxReplicas; + + /* + * Scaling rules. + */ + @JsonProperty(value = "rules") + private List rules; + + /** + * Get the minReplicas property: Optional. Minimum number of container replicas. + * + * @return the minReplicas value. + */ + public Integer minReplicas() { + return this.minReplicas; + } + + /** + * Set the minReplicas property: Optional. Minimum number of container replicas. + * + * @param minReplicas the minReplicas value to set. + * @return the Scale object itself. + */ + public Scale withMinReplicas(Integer minReplicas) { + this.minReplicas = minReplicas; + return this; + } + + /** + * Get the maxReplicas property: Optional. Maximum number of container replicas. Defaults to 10 if not set. + * + * @return the maxReplicas value. + */ + public Integer maxReplicas() { + return this.maxReplicas; + } + + /** + * Set the maxReplicas property: Optional. Maximum number of container replicas. Defaults to 10 if not set. + * + * @param maxReplicas the maxReplicas value to set. + * @return the Scale object itself. + */ + public Scale withMaxReplicas(Integer maxReplicas) { + this.maxReplicas = maxReplicas; + return this; + } + + /** + * Get the rules property: Scaling rules. + * + * @return the rules value. + */ + public List rules() { + return this.rules; + } + + /** + * Set the rules property: Scaling rules. + * + * @param rules the rules value to set. + * @return the Scale object itself. + */ + public Scale withRules(List rules) { + this.rules = rules; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (rules() != null) { + rules().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRule.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRule.java new file mode 100644 index 0000000000000..3bd12dbadf8bf --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRule.java @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App container scaling rule. */ +@Fluent +public final class ScaleRule { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleRule.class); + + /* + * Scale Rule Name + */ + @JsonProperty(value = "name") + private String name; + + /* + * Azure Queue based scaling. + */ + @JsonProperty(value = "azureQueue") + private QueueScaleRule azureQueue; + + /* + * Custom scale rule. + */ + @JsonProperty(value = "custom") + private CustomScaleRule custom; + + /* + * HTTP requests based scaling. + */ + @JsonProperty(value = "http") + private HttpScaleRule http; + + /** + * Get the name property: Scale Rule Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Scale Rule Name. + * + * @param name the name value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the azureQueue property: Azure Queue based scaling. + * + * @return the azureQueue value. + */ + public QueueScaleRule azureQueue() { + return this.azureQueue; + } + + /** + * Set the azureQueue property: Azure Queue based scaling. + * + * @param azureQueue the azureQueue value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withAzureQueue(QueueScaleRule azureQueue) { + this.azureQueue = azureQueue; + return this; + } + + /** + * Get the custom property: Custom scale rule. + * + * @return the custom value. + */ + public CustomScaleRule custom() { + return this.custom; + } + + /** + * Set the custom property: Custom scale rule. + * + * @param custom the custom value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withCustom(CustomScaleRule custom) { + this.custom = custom; + return this; + } + + /** + * Get the http property: HTTP requests based scaling. + * + * @return the http value. + */ + public HttpScaleRule http() { + return this.http; + } + + /** + * Set the http property: HTTP requests based scaling. + * + * @param http the http value to set. + * @return the ScaleRule object itself. + */ + public ScaleRule withHttp(HttpScaleRule http) { + this.http = http; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (azureQueue() != null) { + azureQueue().validate(); + } + if (custom() != null) { + custom().validate(); + } + if (http() != null) { + http().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRuleAuth.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRuleAuth.java new file mode 100644 index 0000000000000..51d9a0d855f38 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/ScaleRuleAuth.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Auth Secrets for Container App Scale Rule. */ +@Fluent +public final class ScaleRuleAuth { + @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleRuleAuth.class); + + /* + * Name of the Container App secret from which to pull the auth params. + */ + @JsonProperty(value = "secretRef") + private String secretRef; + + /* + * Trigger Parameter that uses the secret + */ + @JsonProperty(value = "triggerParameter") + private String triggerParameter; + + /** + * Get the secretRef property: Name of the Container App secret from which to pull the auth params. + * + * @return the secretRef value. + */ + public String secretRef() { + return this.secretRef; + } + + /** + * Set the secretRef property: Name of the Container App secret from which to pull the auth params. + * + * @param secretRef the secretRef value to set. + * @return the ScaleRuleAuth object itself. + */ + public ScaleRuleAuth withSecretRef(String secretRef) { + this.secretRef = secretRef; + return this; + } + + /** + * Get the triggerParameter property: Trigger Parameter that uses the secret. + * + * @return the triggerParameter value. + */ + public String triggerParameter() { + return this.triggerParameter; + } + + /** + * Set the triggerParameter property: Trigger Parameter that uses the secret. + * + * @param triggerParameter the triggerParameter value to set. + * @return the ScaleRuleAuth object itself. + */ + public ScaleRuleAuth withTriggerParameter(String triggerParameter) { + this.triggerParameter = triggerParameter; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Secret.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Secret.java new file mode 100644 index 0000000000000..eb3a7daca0f19 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Secret.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Container App Secret. */ +@Fluent +public final class Secret { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Secret.class); + + /* + * Secret Name. + */ + @JsonProperty(value = "name") + private String name; + + /* + * Secret Value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the name property: Secret Name. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Secret Name. + * + * @param name the name value to set. + * @return the Secret object itself. + */ + public Secret withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value property: Secret Value. + * + * @return the value value. + */ + public String value() { + return this.value; + } + + /** + * Set the value property: Secret Value. + * + * @param value the value value to set. + * @return the Secret object itself. + */ + public Secret withValue(String value) { + this.value = value; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControl.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControl.java new file mode 100644 index 0000000000000..0013813792383 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControl.java @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; + +/** An immutable client-side representation of SourceControl. */ +public interface SourceControl { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the operationState property: Current provisioning State of the operation. + * + * @return the operationState value. + */ + SourceControlOperationState operationState(); + + /** + * Gets the repoUrl property: The repo url which will be integrated to ContainerApp. + * + * @return the repoUrl value. + */ + String repoUrl(); + + /** + * Gets the branch property: The branch which will trigger the auto deployment. + * + * @return the branch value. + */ + String branch(); + + /** + * Gets the githubActionConfiguration property: Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * + * @return the githubActionConfiguration value. + */ + GithubActionConfiguration githubActionConfiguration(); + + /** + * Gets the inner com.azure.resourcemanager.app.fluent.models.SourceControlInner object. + * + * @return the inner object. + */ + SourceControlInner innerModel(); + + /** The entirety of the SourceControl definition. */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + /** The SourceControl definition stages. */ + interface DefinitionStages { + /** The first stage of the SourceControl definition. */ + interface Blank extends WithParentResource { + } + /** The stage of the SourceControl definition allowing to specify parent resource. */ + interface WithParentResource { + /** + * Specifies resourceGroupName, containerAppName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param containerAppName Name of the Container App. + * @return the next definition stage. + */ + WithCreate withExistingContainerApp(String resourceGroupName, String containerAppName); + } + /** + * The stage of the SourceControl 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.WithRepoUrl, + DefinitionStages.WithBranch, + DefinitionStages.WithGithubActionConfiguration { + /** + * Executes the create request. + * + * @return the created resource. + */ + SourceControl create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SourceControl create(Context context); + } + /** The stage of the SourceControl definition allowing to specify repoUrl. */ + interface WithRepoUrl { + /** + * Specifies the repoUrl property: The repo url which will be integrated to ContainerApp.. + * + * @param repoUrl The repo url which will be integrated to ContainerApp. + * @return the next definition stage. + */ + WithCreate withRepoUrl(String repoUrl); + } + /** The stage of the SourceControl definition allowing to specify branch. */ + interface WithBranch { + /** + * Specifies the branch property: The branch which will trigger the auto deployment. + * + * @param branch The branch which will trigger the auto deployment. + * @return the next definition stage. + */ + WithCreate withBranch(String branch); + } + /** The stage of the SourceControl definition allowing to specify githubActionConfiguration. */ + interface WithGithubActionConfiguration { + /** + * Specifies the githubActionConfiguration property: Container App Revision Template with all possible + * settings and the defaults if user did not provide them. The defaults are populated as they were at the + * creation time. + * + * @param githubActionConfiguration Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * @return the next definition stage. + */ + WithCreate withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration); + } + } + /** + * Begins update for the SourceControl resource. + * + * @return the stage of resource update. + */ + SourceControl.Update update(); + + /** The template for SourceControl update. */ + interface Update + extends UpdateStages.WithRepoUrl, UpdateStages.WithBranch, UpdateStages.WithGithubActionConfiguration { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SourceControl apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SourceControl apply(Context context); + } + /** The SourceControl update stages. */ + interface UpdateStages { + /** The stage of the SourceControl update allowing to specify repoUrl. */ + interface WithRepoUrl { + /** + * Specifies the repoUrl property: The repo url which will be integrated to ContainerApp.. + * + * @param repoUrl The repo url which will be integrated to ContainerApp. + * @return the next definition stage. + */ + Update withRepoUrl(String repoUrl); + } + /** The stage of the SourceControl update allowing to specify branch. */ + interface WithBranch { + /** + * Specifies the branch property: The branch which will trigger the auto deployment. + * + * @param branch The branch which will trigger the auto deployment. + * @return the next definition stage. + */ + Update withBranch(String branch); + } + /** The stage of the SourceControl update allowing to specify githubActionConfiguration. */ + interface WithGithubActionConfiguration { + /** + * Specifies the githubActionConfiguration property: Container App Revision Template with all possible + * settings and the defaults if user did not provide them. The defaults are populated as they were at the + * creation time. + * + * @param githubActionConfiguration Container App Revision Template with all possible settings and the + * defaults if user did not provide them. The defaults are populated as they were at the creation time. + * @return the next definition stage. + */ + Update withGithubActionConfiguration(GithubActionConfiguration githubActionConfiguration); + } + } + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SourceControl refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SourceControl refresh(Context context); +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlCollection.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlCollection.java new file mode 100644 index 0000000000000..b3571306596ac --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlCollection.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.app.fluent.models.SourceControlInner; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** SourceControl collection ARM resource. */ +@Fluent +public final class SourceControlCollection { + @JsonIgnore private final ClientLogger logger = new ClientLogger(SourceControlCollection.class); + + /* + * 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; + + /** + * 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 SourceControlCollection object itself. + */ + public SourceControlCollection 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 SourceControlCollection")); + } else { + value().forEach(e -> e.validate()); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlOperationState.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlOperationState.java new file mode 100644 index 0000000000000..e951a1ba9ca44 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/SourceControlOperationState.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.util.ExpandableStringEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.Collection; + +/** Defines values for SourceControlOperationState. */ +public final class SourceControlOperationState extends ExpandableStringEnum { + /** Static value InProgress for SourceControlOperationState. */ + public static final SourceControlOperationState IN_PROGRESS = fromString("InProgress"); + + /** Static value Succeeded for SourceControlOperationState. */ + public static final SourceControlOperationState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for SourceControlOperationState. */ + public static final SourceControlOperationState FAILED = fromString("Failed"); + + /** Static value Canceled for SourceControlOperationState. */ + public static final SourceControlOperationState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a SourceControlOperationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding SourceControlOperationState. + */ + @JsonCreator + public static SourceControlOperationState fromString(String name) { + return fromString(name, SourceControlOperationState.class); + } + + /** @return known SourceControlOperationState values. */ + public static Collection values() { + return values(SourceControlOperationState.class); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Template.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Template.java new file mode 100644 index 0000000000000..062ca3ccbd293 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/Template.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + +/** + * Container App 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 Template { + @JsonIgnore private final ClientLogger logger = new ClientLogger(Template.class); + + /* + * User friendly suffix that is appended to the revision name + */ + @JsonProperty(value = "revisionSuffix") + private String revisionSuffix; + + /* + * List of container definitions for the Container App. + */ + @JsonProperty(value = "containers") + private List containers; + + /* + * Scaling properties for the Container App. + */ + @JsonProperty(value = "scale") + private Scale scale; + + /* + * Dapr configuration for the Container App. + */ + @JsonProperty(value = "dapr") + private Dapr dapr; + + /** + * Get the revisionSuffix property: User friendly suffix that is appended to the revision name. + * + * @return the revisionSuffix value. + */ + public String revisionSuffix() { + return this.revisionSuffix; + } + + /** + * Set the revisionSuffix property: User friendly suffix that is appended to the revision name. + * + * @param revisionSuffix the revisionSuffix value to set. + * @return the Template object itself. + */ + public Template withRevisionSuffix(String revisionSuffix) { + this.revisionSuffix = revisionSuffix; + 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 Template object itself. + */ + public Template withContainers(List containers) { + this.containers = containers; + return this; + } + + /** + * Get the scale property: Scaling properties for the Container App. + * + * @return the scale value. + */ + public Scale scale() { + return this.scale; + } + + /** + * Set the scale property: Scaling properties for the Container App. + * + * @param scale the scale value to set. + * @return the Template object itself. + */ + public Template withScale(Scale scale) { + this.scale = scale; + return this; + } + + /** + * Get the dapr property: Dapr configuration for the Container App. + * + * @return the dapr value. + */ + public Dapr dapr() { + return this.dapr; + } + + /** + * Set the dapr property: Dapr configuration for the Container App. + * + * @param dapr the dapr value to set. + * @return the Template object itself. + */ + public Template withDapr(Dapr dapr) { + this.dapr = dapr; + 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 (scale() != null) { + scale().validate(); + } + if (dapr() != null) { + dapr().validate(); + } + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TrafficWeight.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TrafficWeight.java new file mode 100644 index 0000000000000..0708f5fa4f48d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/TrafficWeight.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Traffic weight assigned to a revision. */ +@Fluent +public final class TrafficWeight { + @JsonIgnore private final ClientLogger logger = new ClientLogger(TrafficWeight.class); + + /* + * Name of a revision + */ + @JsonProperty(value = "revisionName") + private String revisionName; + + /* + * Traffic weight assigned to a revision + */ + @JsonProperty(value = "weight") + private Integer weight; + + /* + * Indicates that the traffic weight belongs to a latest stable revision + */ + @JsonProperty(value = "latestRevision") + private Boolean latestRevision; + + /** + * Get the revisionName property: Name of a revision. + * + * @return the revisionName value. + */ + public String revisionName() { + return this.revisionName; + } + + /** + * Set the revisionName property: Name of a revision. + * + * @param revisionName the revisionName value to set. + * @return the TrafficWeight object itself. + */ + public TrafficWeight withRevisionName(String revisionName) { + this.revisionName = revisionName; + return this; + } + + /** + * Get the weight property: Traffic weight assigned to a revision. + * + * @return the weight value. + */ + public Integer weight() { + return this.weight; + } + + /** + * Set the weight property: Traffic weight assigned to a revision. + * + * @param weight the weight value to set. + * @return the TrafficWeight object itself. + */ + public TrafficWeight withWeight(Integer weight) { + this.weight = weight; + return this; + } + + /** + * Get the latestRevision property: Indicates that the traffic weight belongs to a latest stable revision. + * + * @return the latestRevision value. + */ + public Boolean latestRevision() { + return this.latestRevision; + } + + /** + * Set the latestRevision property: Indicates that the traffic weight belongs to a latest stable revision. + * + * @param latestRevision the latestRevision value to set. + * @return the TrafficWeight object itself. + */ + public TrafficWeight withLatestRevision(Boolean latestRevision) { + this.latestRevision = latestRevision; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VnetConfiguration.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VnetConfiguration.java new file mode 100644 index 0000000000000..957005109bfea --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/VnetConfiguration.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** Configuration properties for apps environment to join a Virtual Network. */ +@Fluent +public final class VnetConfiguration { + @JsonIgnore private final ClientLogger logger = new ClientLogger(VnetConfiguration.class); + + /* + * 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. + */ + @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. + */ + @JsonProperty(value = "dockerBridgeCidr") + private String dockerBridgeCidr; + + /* + * IP range in CIDR notation that can be reserved for environment + * infrastructure IP addresses. Must not overlap with any other provided IP + * ranges. + */ + @JsonProperty(value = "platformReservedCidr") + private String platformReservedCidr; + + /* + * An IP address from the IP range defined by platformReservedCidr that + * will be reserved for the internal DNS server. + */ + @JsonProperty(value = "platformReservedDnsIP") + private String platformReservedDnsIp; + + /** + * 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. + * + * @return the infrastructureSubnetId value. + */ + public String infrastructureSubnetId() { + return this.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. + * + * @param infrastructureSubnetId the infrastructureSubnetId value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withInfrastructureSubnetId(String infrastructureSubnetId) { + this.infrastructureSubnetId = infrastructureSubnetId; + 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. + * + * @return the dockerBridgeCidr value. + */ + public String dockerBridgeCidr() { + return this.dockerBridgeCidr; + } + + /** + * Set the dockerBridgeCidr property: CIDR notation IP range assigned to the Docker bridge, network. Must not + * overlap with any other provided IP ranges. + * + * @param dockerBridgeCidr the dockerBridgeCidr value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withDockerBridgeCidr(String dockerBridgeCidr) { + this.dockerBridgeCidr = dockerBridgeCidr; + return this; + } + + /** + * Get the platformReservedCidr property: IP range in CIDR notation that can be reserved for environment + * infrastructure IP addresses. Must not overlap with any other provided IP ranges. + * + * @return the platformReservedCidr value. + */ + public String platformReservedCidr() { + return this.platformReservedCidr; + } + + /** + * Set the platformReservedCidr property: IP range in CIDR notation that can be reserved for environment + * infrastructure IP addresses. Must not overlap with any other provided IP ranges. + * + * @param platformReservedCidr the platformReservedCidr value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withPlatformReservedCidr(String platformReservedCidr) { + this.platformReservedCidr = platformReservedCidr; + return this; + } + + /** + * Get the platformReservedDnsIp property: An IP address from the IP range defined by platformReservedCidr that will + * be reserved for the internal DNS server. + * + * @return the platformReservedDnsIp value. + */ + public String platformReservedDnsIp() { + return this.platformReservedDnsIp; + } + + /** + * Set the platformReservedDnsIp property: An IP address from the IP range defined by platformReservedCidr that will + * be reserved for the internal DNS server. + * + * @param platformReservedDnsIp the platformReservedDnsIp value to set. + * @return the VnetConfiguration object itself. + */ + public VnetConfiguration withPlatformReservedDnsIp(String platformReservedDnsIp) { + this.platformReservedDnsIp = platformReservedDnsIp; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/package-info.java new file mode 100644 index 0000000000000..a76d1f5fed9ef --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/models/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the data models for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app.models; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/package-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/package-info.java new file mode 100644 index 0000000000000..40481efaf8bf2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/com/azure/resourcemanager/app/package-info.java @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** Package containing the classes for ContainerAppsApiClient. null. */ +package com.azure.resourcemanager.app; diff --git a/sdk/app/azure-resourcemanager-app/src/main/java/module-info.java b/sdk/app/azure-resourcemanager-app/src/main/java/module-info.java new file mode 100644 index 0000000000000..9a9e9c0342a92 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/main/java/module-info.java @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +module com.azure.resourcemanager.app { + requires transitive com.azure.core.management; + + exports com.azure.resourcemanager.app; + exports com.azure.resourcemanager.app.fluent; + exports com.azure.resourcemanager.app.fluent.models; + exports com.azure.resourcemanager.app.models; + + opens com.azure.resourcemanager.app.fluent.models to + com.azure.core, + com.fasterxml.jackson.databind; + opens com.azure.resourcemanager.app.models to + com.azure.core, + com.fasterxml.jackson.databind; +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..ce90226758922 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsCreateOrUpdateSamples.java @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.AppProtocol; +import com.azure.resourcemanager.app.models.Configuration; +import com.azure.resourcemanager.app.models.Container; +import com.azure.resourcemanager.app.models.CustomScaleRule; +import com.azure.resourcemanager.app.models.Dapr; +import com.azure.resourcemanager.app.models.Ingress; +import com.azure.resourcemanager.app.models.Scale; +import com.azure.resourcemanager.app.models.ScaleRule; +import com.azure.resourcemanager.app.models.Template; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps CreateOrUpdate. */ +public final class ContainerAppsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerApps() + .define("testcontainerApp0") + .withRegion("East US") + .withExistingResourceGroup("rg") + .withManagedEnvironmentId( + "/subscriptions/34adfa4f-cedf-4dc0-ba29-b6d1a69ab345/resourceGroups/rg/providers/Microsoft.App/managedEnvironments/demokube") + .withConfiguration(new Configuration().withIngress(new Ingress().withExternal(true).withTargetPort(3000))) + .withTemplate( + new Template() + .withContainers( + Arrays + .asList( + new Container().withImage("repo/testcontainerApp0:v1").withName("testcontainerApp0"))) + .withScale( + new Scale() + .withMinReplicas(1) + .withMaxReplicas(5) + .withRules( + Arrays + .asList( + new ScaleRule() + .withName("httpscalingrule") + .withCustom( + new CustomScaleRule() + .withType("http") + .withMetadata(mapOf("concurrentRequests", "50")))))) + .withDapr(new Dapr().withEnabled(true).withAppProtocol(AppProtocol.HTTP).withAppPort(3000))) + .create(); + } + + @SuppressWarnings("unchecked") + private static Map mapOf(Object... inputs) { + Map map = new HashMap<>(); + for (int i = 0; i < inputs.length; i += 2) { + String key = (String) inputs[i]; + T value = (T) inputs[i + 1]; + map.put(key, value); + } + return map; + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsDeleteSamples.java new file mode 100644 index 0000000000000..d60e2aadd0b19 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/ContainerApps_Delete.json + */ + /** + * Sample code: Delete Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().delete("rg", "testWorkerApp0", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsGetByResourceGroupSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..0fad12a66e13f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/ContainerApps_Get.json + */ + /** + * Sample code: Get Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListByResourceGroupSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..7448c939a557f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/ContainerApps_ListByResourceGroup.json + */ + /** + * Sample code: List Container Apps by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsByResourceGroup(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().listByResourceGroup("rg", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSamples.java new file mode 100644 index 0000000000000..fa7e28d2947cd --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/ContainerApps_ListBySubscription.json + */ + /** + * Sample code: List Container Apps by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppsBySubscription(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerApps().list(Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasGetReplicaSamples.java new file mode 100644 index 0000000000000..78fd3b10b3cdb --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasGetReplicaSamples.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.app.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-01-01-preview/examples/Replicas_Get.json + */ + /** + * Sample code: Get Container App's revision replica. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSRevisionReplica(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisionReplicas() + .getReplicaWithResponse( + "workerapps-rg-xj", "myapp", "myapp--0wlqy09", "myapp--0wlqy09-5d9774cff-5wnd8", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasListReplicasSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasListReplicasSamples.java new file mode 100644 index 0000000000000..0376dfa50c56d --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionReplicasListReplicasSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/Replicas_List.json + */ + /** + * Sample code: List Container App's replicas. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppSReplicas(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisionReplicas() + .listReplicasWithResponse("workerapps-rg-xj", "myapp", "myapp--0wlqy09", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsActivateRevisionSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsActivateRevisionSamples.java new file mode 100644 index 0000000000000..d02b4bd2234b4 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsActivateRevisionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/Revisions_Activate.json + */ + /** + * Sample code: Activate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void activateContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .activateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java new file mode 100644 index 0000000000000..c4c05938450c7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsDeactivateRevisionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/Revisions_Deactivate.json + */ + /** + * Sample code: Deactivate Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deactivateContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .deactivateRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsGetRevisionSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsGetRevisionSamples.java new file mode 100644 index 0000000000000..443e1f197fab1 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsGetRevisionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/Revisions_Get.json + */ + /** + * Sample code: Get Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .getRevisionWithResponse("rg", "testcontainerApp0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsListRevisionsSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsListRevisionsSamples.java new file mode 100644 index 0000000000000..548c059cbc36b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsListRevisionsSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/Revisions_List.json + */ + /** + * Sample code: List Container App's revisions. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listContainerAppSRevisions(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsRevisions().listRevisions("rg", "testcontainerApp0", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsRestartRevisionSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsRestartRevisionSamples.java new file mode 100644 index 0000000000000..d32b68fcb3230 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsRevisionsRestartRevisionSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/Revisions_Restart.json + */ + /** + * Sample code: Restart Container App's revision. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void restartContainerAppSRevision(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsRevisions() + .restartRevisionWithResponse("rg", "testStaticSite0", "testcontainerApp0-pjxhsye", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..43d8b0301cdf7 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsCreateOrUpdateSamples.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.resourcemanager.app.models.AzureCredentials; +import com.azure.resourcemanager.app.models.GithubActionConfiguration; +import com.azure.resourcemanager.app.models.RegistryInfo; + +/** Samples for ContainerAppsSourceControls CreateOrUpdate. */ +public final class ContainerAppsSourceControlsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/SourceControls_CreateOrUpdate.json + */ + /** + * Sample code: Create or Update Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateContainerAppSourceControl( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsSourceControls() + .define("current") + .withExistingContainerApp("workerapps-rg-xj", "testcanadacentral") + .withRepoUrl("https://github.com/xwang971/ghatest") + .withBranch("master") + .withGithubActionConfiguration( + new GithubActionConfiguration() + .withRegistryInfo( + new RegistryInfo() + .withRegistryUrl("xwang971reg.azurecr.io") + .withRegistryUsername("xwang971reg") + .withRegistryPassword("")) + .withAzureCredentials( + new AzureCredentials() + .withClientId("") + .withClientSecret("") + .withTenantId(""))) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsDeleteSamples.java new file mode 100644 index 0000000000000..0a81b5ba112af --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/SourceControls_Delete.json + */ + /** + * Sample code: Delete Container App SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteContainerAppSourceControl(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls().delete("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsGetSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsGetSamples.java new file mode 100644 index 0000000000000..3ca95369ac581 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsGetSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/SourceControls_Get.json + */ + /** + * Sample code: Get Container App's SourceControl. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getContainerAppSSourceControl(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .containerAppsSourceControls() + .getWithResponse("workerapps-rg-xj", "testcanadacentral", "current", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsListByContainerAppSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsListByContainerAppSamples.java new file mode 100644 index 0000000000000..2d385983ba043 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsSourceControlsListByContainerAppSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/SourceControls_ListByContainer.json + */ + /** + * Sample code: List App's Source Controls. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAppSSourceControls(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.containerAppsSourceControls().listByContainerApp("workerapps-rg-xj", "testcanadacentral", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsUpdateSamples.java new file mode 100644 index 0000000000000..15c48aa081477 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ContainerAppsUpdateSamples.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.models.ContainerApp; +import java.util.HashMap; +import java.util.Map; + +/** Samples for ContainerApps Update. */ +public final class ContainerAppsUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ContainerApps_Patch.json + */ + /** + * Sample code: Patch Container App. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchContainerApp(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + ContainerApp resource = + manager.containerApps().getByResourceGroupWithResponse("rg", "testcontainerApp0", 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/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..b031e13dbf59e --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsCreateOrUpdateSamples.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.app.generated; + +import com.azure.resourcemanager.app.models.AppLogsConfiguration; +import com.azure.resourcemanager.app.models.LogAnalyticsConfiguration; + +/** Samples for ManagedEnvironments CreateOrUpdate. */ +public final class ManagedEnvironmentsCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironments_CreateOrUpdate.json + */ + /** + * Sample code: Create environments. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createEnvironments(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .managedEnvironments() + .define("testcontainerenv") + .withRegion("East US") + .withExistingResourceGroup("examplerg") + .withAppLogsConfiguration( + new AppLogsConfiguration() + .withLogAnalyticsConfiguration( + new LogAnalyticsConfiguration().withCustomerId("string").withSharedKey("string"))) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsDeleteSamples.java new file mode 100644 index 0000000000000..2de0d97712a33 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsDeleteSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/ManagedEnvironments_Delete.json + */ + /** + * Sample code: Delete environment by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void deleteEnvironmentByName(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().delete("examplerg", "examplekenv", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsGetByResourceGroupSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsGetByResourceGroupSamples.java new file mode 100644 index 0000000000000..c6a6b8e574c35 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsGetByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/ManagedEnvironments_Get.json + */ + /** + * Sample code: Get environments by name. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getEnvironmentsByName(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().getByResourceGroupWithResponse("examplerg", "jlaw-demo1", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListByResourceGroupSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListByResourceGroupSamples.java new file mode 100644 index 0000000000000..9325de837c354 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListByResourceGroupSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/ManagedEnvironments_ListByResourceGroup.json + */ + /** + * Sample code: List environments by resource group. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsByResourceGroup(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().listByResourceGroup("examplerg", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListSamples.java new file mode 100644 index 0000000000000..5c4ecebe3da95 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/ManagedEnvironments_ListBySubscription.json + */ + /** + * Sample code: List environments by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsBySubscription(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironments().list(Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.java new file mode 100644 index 0000000000000..391f0c2d4c4aa --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesCreateOrUpdateSamples.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.app.generated; + +import com.azure.resourcemanager.app.models.AccessMode; +import com.azure.resourcemanager.app.models.AzureFileProperties; +import com.azure.resourcemanager.app.models.ManagedEnvironmentStorageProperties; + +/** Samples for ManagedEnvironmentsStorages CreateOrUpdate. */ +public final class ManagedEnvironmentsStoragesCreateOrUpdateSamples { + /* + * x-ms-original-file: specification/app/resource-manager/Microsoft.App/preview/2022-01-01-preview/examples/ManagedEnvironmentsStorages_CreateOrUpdate.json + */ + /** + * Sample code: Create or update environments storage. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void createOrUpdateEnvironmentsStorage( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager + .managedEnvironmentsStorages() + .define("jlaw-demo1") + .withExistingManagedEnvironment("examplerg", "managedEnv") + .withProperties( + new ManagedEnvironmentStorageProperties() + .withAzureFile( + new AzureFileProperties() + .withAccountName("account1") + .withAccountKey("key") + .withAccessMode(AccessMode.READ_ONLY) + .withShareName("share1"))) + .create(); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesDeleteSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesDeleteSamples.java new file mode 100644 index 0000000000000..6ff838b725b3c --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesDeleteSamples.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.app.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-01-01-preview/examples/ManagedEnvironmentsStorages_Delete.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().deleteWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesGetSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesGetSamples.java new file mode 100644 index 0000000000000..00315d2f0ac1b --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesGetSamples.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.app.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-01-01-preview/examples/ManagedEnvironmentsStorages_Get.json + */ + /** + * Sample code: get a environments storage properties by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void getAEnvironmentsStoragePropertiesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().getWithResponse("examplerg", "managedEnv", "jlaw-demo1", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesListSamples.java new file mode 100644 index 0000000000000..c31205c4fa9a2 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsStoragesListSamples.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.app.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-01-01-preview/examples/ManagedEnvironmentsStorages_List.json + */ + /** + * Sample code: List environments storages by subscription. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listEnvironmentsStoragesBySubscription( + com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.managedEnvironmentsStorages().listWithResponse("examplerg", "managedEnv", Context.NONE); + } +} diff --git a/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsUpdateSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsUpdateSamples.java new file mode 100644 index 0000000000000..fb16ce567dc45 --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/ManagedEnvironmentsUpdateSamples.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.app.generated; + +import com.azure.core.util.Context; +import com.azure.resourcemanager.app.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-01-01-preview/examples/ManagedEnvironments_Patch.json + */ + /** + * Sample code: Patch Managed Environment. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void patchManagedEnvironment(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + ManagedEnvironment resource = + manager + .managedEnvironments() + .getByResourceGroupWithResponse("examplerg", "testcontainerenv", 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/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/OperationsListSamples.java b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/OperationsListSamples.java new file mode 100644 index 0000000000000..41fb58188b27f --- /dev/null +++ b/sdk/app/azure-resourcemanager-app/src/samples/java/com/azure/resourcemanager/app/generated/OperationsListSamples.java @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.app.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-01-01-preview/examples/Operations_List.json + */ + /** + * Sample code: List all operations. + * + * @param manager Entry point to ContainerAppsApiManager. + */ + public static void listAllOperations(com.azure.resourcemanager.app.ContainerAppsApiManager manager) { + manager.operations().list(Context.NONE); + } +} diff --git a/sdk/app/ci.yml b/sdk/app/ci.yml new file mode 100644 index 0000000000000..28b46eddc610b --- /dev/null +++ b/sdk/app/ci.yml @@ -0,0 +1,39 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/app/ci.yml + - sdk/app/azure-resourcemanager-app/ + exclude: + - sdk/app/pom.xml + - sdk/app/azure-resourcemanager-app/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/app/ci.yml + - sdk/app/azure-resourcemanager-app/ + exclude: + - sdk/app/pom.xml + - sdk/app/azure-resourcemanager-app/pom.xml + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: app + Artifacts: + - name: azure-resourcemanager-app + groupId: com.azure.resourcemanager + safeName: azureresourcemanagerapp diff --git a/sdk/app/pom.xml b/sdk/app/pom.xml new file mode 100644 index 0000000000000..b126fd1965d1d --- /dev/null +++ b/sdk/app/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + com.azure + azure-app-service + pom + 1.0.0 + + + + coverage + + + + + + + + + + org.jacoco + jacoco-maven-plugin + 0.8.5 + + + report-aggregate + verify + + report-aggregate + + + ${project.reporting.outputDirectory}/test-coverage + + + + + + + + + default + + true + + + azure-resourcemanager-app + + + +