From 4d74726384f0aadd53b63e89d6b58c6915df341b Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 17 Oct 2025 11:49:15 +0800 Subject: [PATCH 1/4] add api-specs --- sdk/resourcemanager/api-specs.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index d967389c3529..4143d406002a 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -56,10 +56,16 @@ }, "containerregistry": { "dir": "../containerregistry/azure-resourcemanager-containerregistry", - "source": "specification/containerregistry/resource-manager/readme.md", + "source": "specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/Registry/readme.md", "package": "com.azure.resourcemanager.containerregistry", "args": "--tag=package-2025-04 --modelerfour.lenient-model-deduplication=true --enable-sync-stack=false" }, + "containerregistrytasks": { + "dir": "../containerregistry/azure-resourcemanager-containerregistry", + "source": "specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/readme.md", + "package": "com.azure.resourcemanager.containerregistry", + "args": "--tag=package-2019-06-preview --modelerfour.lenient-model-deduplication=true --enable-sync-stack=false" + }, "containerregistry-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-containerregistry", "source": "specification/containerregistry/resource-manager/readme.md", From aea25bca1f085a6da8b8b2b0e2dcf48c673eb09a Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 17 Oct 2025 13:00:10 +0800 Subject: [PATCH 2/4] regen and adapt --- .../ContainerRegistryManager.java | 19 + .../ContainerRegistryManagementClient.java | 35 +- ...ontainerRegistryTasksManagementClient.java | 83 +++ .../fluent/RegistriesClient.java | 164 ------ .../fluent/RegistryTasksClient.java | 185 +++++++ .../fluent/models/package-info.java | 2 +- .../fluent/package-info.java | 2 +- .../implementation/AgentPoolsClientImpl.java | 52 +- .../implementation/CacheRulesClientImpl.java | 54 +- .../ConnectedRegistriesClientImpl.java | 63 +-- ...ContainerRegistryManagementClientImpl.java | 79 +-- ...rRegistryTasksManagementClientBuilder.java | 139 +++++ ...inerRegistryTasksManagementClientImpl.java | 205 +++++++ .../CredentialSetsClientImpl.java | 54 +- .../implementation/OperationsClientImpl.java | 10 +- .../PrivateEndpointConnectionsClientImpl.java | 44 +- .../implementation/RegistriesClientImpl.java | 507 ++---------------- .../implementation/RegistriesImpl.java | 4 +- .../implementation/RegistryImpl.java | 4 +- .../implementation/RegistryTaskImpl.java | 4 +- .../implementation/RegistryTaskRunImpl.java | 8 +- .../implementation/RegistryTaskRunsImpl.java | 6 +- .../RegistryTasksClientImpl.java | 438 +++++++++++++++ .../implementation/RegistryTasksImpl.java | 10 +- .../ReplicationsClientImpl.java | 54 +- .../implementation/RunsClientImpl.java | 47 +- .../implementation/ScopeMapsClientImpl.java | 54 +- .../implementation/TaskRunsClientImpl.java | 49 +- .../implementation/TasksClientImpl.java | 50 +- .../implementation/TokensClientImpl.java | 54 +- .../implementation/WebhooksClientImpl.java | 80 ++- .../models/IdentityProperties.java | 24 + .../models/TaskStepProperties.java | 6 +- .../models/UserIdentityProperties.java | 28 +- .../models/package-info.java | 2 +- .../containerregistry/package-info.java | 2 +- .../proxy-config.json | 2 +- .../containerregistry/RegistryTaskTests.java | 2 +- 38 files changed, 1491 insertions(+), 1134 deletions(-) create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ContainerRegistryTasksManagementClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java index 6dc65d0cd3d9..642f98bbe52b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java @@ -6,7 +6,9 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpPipeline; import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryManagementClient; +import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryTasksManagementClient; import com.azure.resourcemanager.containerregistry.implementation.ContainerRegistryManagementClientBuilder; +import com.azure.resourcemanager.containerregistry.implementation.ContainerRegistryTasksManagementClientBuilder; import com.azure.resourcemanager.containerregistry.implementation.RegistriesImpl; import com.azure.resourcemanager.containerregistry.implementation.RegistryTaskRunsImpl; import com.azure.resourcemanager.containerregistry.implementation.RegistryTasksImpl; @@ -28,6 +30,8 @@ public final class ContainerRegistryManager extends Manager>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, String registryName, - RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest, Context context); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, - String registryName); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, - String registryName, Context context); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java new file mode 100644 index 000000000000..5d75bd26481b --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; +import com.azure.resourcemanager.containerregistry.models.RunRequest; +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 RegistryTasksClient. + */ +public interface RegistryTasksClient { + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, String registryName, + RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, + RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, + RunRequest runRequest, Context context); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, + String registryName); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, + String registryName, Context context); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java index 698c3223c4b2..4d3732d2d395 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the inner data models for ContainerRegistryManagementClient. + * Package containing the inner data models for ContainerRegistryTasksManagementClient. * null. */ package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java index a638f173104b..6a8c66a88093 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the service clients for ContainerRegistryManagementClient. + * Package containing the service clients for ContainerRegistryTasksManagementClient. * null. */ package com.azure.resourcemanager.containerregistry.fluent; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java index 3acd76ee0bad..c5b148cc9de8 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java @@ -54,25 +54,25 @@ public final class AgentPoolsClientImpl implements AgentPoolsClient { /** * The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; + private final ContainerRegistryTasksManagementClientImpl client; /** * Initializes an instance of AgentPoolsClientImpl. * * @param client the instance of the service client containing this operation class. */ - AgentPoolsClientImpl(ContainerRegistryManagementClientImpl client) { + AgentPoolsClientImpl(ContainerRegistryTasksManagementClientImpl client) { this.service = RestProxy.create(AgentPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ContainerRegistryManagementClientAgentPools to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for ContainerRegistryTasksManagementClientAgentPools to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientAgentPools") public interface AgentPoolsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") @@ -176,11 +176,10 @@ public Mono> getWithResponseAsync(String resourceGroupN if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -218,11 +217,10 @@ private Mono> getWithResponseAsync(String resourceGroup if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, agentPoolName, accept, context); + this.client.getApiVersion(), agentPoolName, accept, context); } /** @@ -315,11 +313,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { agentPool.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, agentPool, accept, context)) + .withContext( + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), agentPoolName, agentPool, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -363,11 +361,10 @@ private Mono>> createWithResponseAsync(String resource } else { agentPool.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, agentPoolName, agentPool, accept, context); + registryName, this.client.getApiVersion(), agentPoolName, agentPool, accept, context); } /** @@ -560,11 +557,10 @@ public Mono>> deleteWithResponseAsync(String resourceG if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -601,11 +597,10 @@ private Mono>> deleteWithResponseAsync(String resource if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, agentPoolName, accept, context); + registryName, this.client.getApiVersion(), agentPoolName, accept, context); } /** @@ -791,11 +786,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { updateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, updateParameters, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), agentPoolName, updateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -840,11 +835,10 @@ private Mono>> updateWithResponseAsync(String resource } else { updateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, agentPoolName, updateParameters, accept, context); + registryName, this.client.getApiVersion(), agentPoolName, updateParameters, accept, context); } /** @@ -1032,11 +1026,10 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, accept, context)) + resourceGroupName, registryName, 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())); @@ -1071,12 +1064,11 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, accept, context) + this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1178,11 +1170,10 @@ public Mono> getQueueStatusWithResponseAsync if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getQueueStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1220,11 +1211,10 @@ private Mono> getQueueStatusWithResponseAsyn if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getQueueStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, agentPoolName, accept, context); + registryName, this.client.getApiVersion(), agentPoolName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CacheRulesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CacheRulesClientImpl.java index 930f5136e876..3e16a3d4e535 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CacheRulesClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CacheRulesClientImpl.java @@ -70,7 +70,7 @@ public final class CacheRulesClientImpl implements CacheRulesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientCacheRules") public interface CacheRulesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/cacheRules") @@ -157,11 +157,10 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -197,12 +196,11 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -308,11 +306,10 @@ public Mono> getWithResponseAsync(String resourceGroupN if (cacheRuleName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, cacheRuleName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, cacheRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -350,11 +347,10 @@ private Mono> getWithResponseAsync(String resourceGroup if (cacheRuleName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, cacheRuleName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, cacheRuleName, accept, context); } /** @@ -448,12 +444,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { cacheRuleCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, cacheRuleName, + cacheRuleCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -498,11 +493,10 @@ private Mono>> createWithResponseAsync(String resource } else { cacheRuleCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, cacheRuleName, cacheRuleCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters, accept, context); } /** @@ -697,10 +691,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (cacheRuleName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, cacheRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -738,11 +731,10 @@ private Mono>> deleteWithResponseAsync(String resource if (cacheRuleName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, cacheRuleName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, cacheRuleName, accept, context); } /** @@ -928,12 +920,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { cacheRuleUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, cacheRuleName, + cacheRuleUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -978,11 +969,10 @@ private Mono>> updateWithResponseAsync(String resource } else { cacheRuleUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, cacheRuleName, cacheRuleUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ConnectedRegistriesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ConnectedRegistriesClientImpl.java index 48d2f65c345d..6a626ed2c13e 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ConnectedRegistriesClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ConnectedRegistriesClientImpl.java @@ -71,7 +71,7 @@ public final class ConnectedRegistriesClientImpl implements ConnectedRegistriesC * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientConnectedRegistries") public interface ConnectedRegistriesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/connectedRegistries/{connectedRegistryName}") @@ -177,11 +177,9 @@ public Mono> getWithResponseAsync(String resour return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, connectedRegistryName, accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -220,11 +218,10 @@ private Mono> getWithResponseAsync(String resou return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, connectedRegistryName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, connectedRegistryName, accept, context); } /** @@ -320,10 +317,9 @@ public Mono>> createWithResponseAsync(String resourceG } else { connectedRegistryCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -371,11 +367,10 @@ private Mono>> createWithResponseAsync(String resource } else { connectedRegistryCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, connectedRegistryName, connectedRegistryCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, accept, context); } /** @@ -593,10 +588,9 @@ public Mono>> updateWithResponseAsync(String resourceG } else { connectedRegistryUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -645,11 +639,10 @@ private Mono>> updateWithResponseAsync(String resource } else { connectedRegistryUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, connectedRegistryName, connectedRegistryUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, accept, context); } /** @@ -861,12 +854,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, connectedRegistryName, accept, context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -904,11 +894,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, connectedRegistryName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, connectedRegistryName, accept, context); } /** @@ -1087,11 +1076,10 @@ private Mono> listSinglePageAsync(String r if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, filter, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1130,12 +1118,11 @@ private Mono> listSinglePageAsync(String r if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, filter, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1271,12 +1258,11 @@ public Mono>> deactivateWithResponseAsync(String resou return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deactivate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, connectedRegistryName, accept, context)) + .withContext(context -> service.deactivate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1314,11 +1300,10 @@ private Mono>> deactivateWithResponseAsync(String reso return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deactivate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, connectedRegistryName, accept, context); + return service.deactivate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java index 072e43d90921..90b1ec42a3c3 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.containerregistry.fluent.AgentPoolsClient; import com.azure.resourcemanager.containerregistry.fluent.CacheRulesClient; import com.azure.resourcemanager.containerregistry.fluent.ConnectedRegistriesClient; import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryManagementClient; @@ -17,10 +16,7 @@ import com.azure.resourcemanager.containerregistry.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; import com.azure.resourcemanager.containerregistry.fluent.ReplicationsClient; -import com.azure.resourcemanager.containerregistry.fluent.RunsClient; import com.azure.resourcemanager.containerregistry.fluent.ScopeMapsClient; -import com.azure.resourcemanager.containerregistry.fluent.TaskRunsClient; -import com.azure.resourcemanager.containerregistry.fluent.TasksClient; import com.azure.resourcemanager.containerregistry.fluent.TokensClient; import com.azure.resourcemanager.containerregistry.fluent.WebhooksClient; import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; @@ -60,6 +56,20 @@ 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. */ @@ -242,62 +252,6 @@ public WebhooksClient getWebhooks() { return this.webhooks; } - /** - * The AgentPoolsClient object to access its operations. - */ - private final AgentPoolsClient agentPools; - - /** - * Gets the AgentPoolsClient object to access its operations. - * - * @return the AgentPoolsClient object. - */ - public AgentPoolsClient getAgentPools() { - return this.agentPools; - } - - /** - * The RunsClient object to access its operations. - */ - private final RunsClient runs; - - /** - * Gets the RunsClient object to access its operations. - * - * @return the RunsClient object. - */ - public RunsClient getRuns() { - return this.runs; - } - - /** - * The TaskRunsClient object to access its operations. - */ - private final TaskRunsClient taskRuns; - - /** - * Gets the TaskRunsClient object to access its operations. - * - * @return the TaskRunsClient object. - */ - public TaskRunsClient getTaskRuns() { - return this.taskRuns; - } - - /** - * The TasksClient object to access its operations. - */ - private final TasksClient tasks; - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - public TasksClient getTasks() { - return this.tasks; - } - /** * Initializes an instance of ContainerRegistryManagementClient client. * @@ -316,6 +270,7 @@ public TasksClient getTasks() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = "2025-04-01"; this.cacheRules = new CacheRulesClientImpl(this); this.connectedRegistries = new ConnectedRegistriesClientImpl(this); this.credentialSets = new CredentialSetsClientImpl(this); @@ -326,9 +281,5 @@ public TasksClient getTasks() { this.scopeMaps = new ScopeMapsClientImpl(this); this.tokens = new TokensClientImpl(this); this.webhooks = new WebhooksClientImpl(this); - this.agentPools = new AgentPoolsClientImpl(this); - this.runs = new RunsClientImpl(this); - this.taskRuns = new TaskRunsClientImpl(this); - this.tasks = new TasksClientImpl(this); } } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java new file mode 100644 index 000000000000..aae9fb50a8d0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the ContainerRegistryTasksManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ContainerRegistryTasksManagementClientImpl.class }) +public final class ContainerRegistryTasksManagementClientBuilder { + /* + * The Microsoft Azure subscription ID. + */ + private String subscriptionId; + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder 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 ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerRegistryTasksManagementClientImpl with the provided parameters. + * + * @return an instance of ContainerRegistryTasksManagementClientImpl. + */ + public ContainerRegistryTasksManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ContainerRegistryTasksManagementClientImpl client + = new ContainerRegistryTasksManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java new file mode 100644 index 000000000000..8f5232a26682 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.resourcemanager.containerregistry.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryTasksManagementClient; +import com.azure.resourcemanager.containerregistry.fluent.RegistryTasksClient; +import com.azure.resourcemanager.containerregistry.fluent.RunsClient; +import com.azure.resourcemanager.containerregistry.fluent.TaskRunsClient; +import com.azure.resourcemanager.containerregistry.fluent.TasksClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; +import java.time.Duration; + +/** + * Initializes a new instance of the ContainerRegistryTasksManagementClientImpl type. + */ +@ServiceClient(builder = ContainerRegistryTasksManagementClientBuilder.class) +public final class ContainerRegistryTasksManagementClientImpl extends AzureServiceClient + implements ContainerRegistryTasksManagementClient { + /** + * The Microsoft Azure subscription ID. + */ + private final String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @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 AgentPoolsClient object to access its operations. + */ + private final AgentPoolsClient agentPools; + + /** + * Gets the AgentPoolsClient object to access its operations. + * + * @return the AgentPoolsClient object. + */ + public AgentPoolsClient getAgentPools() { + return this.agentPools; + } + + /** + * The RegistryTasksClient object to access its operations. + */ + private final RegistryTasksClient registryTasks; + + /** + * Gets the RegistryTasksClient object to access its operations. + * + * @return the RegistryTasksClient object. + */ + public RegistryTasksClient getRegistryTasks() { + return this.registryTasks; + } + + /** + * The RunsClient object to access its operations. + */ + private final RunsClient runs; + + /** + * Gets the RunsClient object to access its operations. + * + * @return the RunsClient object. + */ + public RunsClient getRuns() { + return this.runs; + } + + /** + * The TaskRunsClient object to access its operations. + */ + private final TaskRunsClient taskRuns; + + /** + * Gets the TaskRunsClient object to access its operations. + * + * @return the TaskRunsClient object. + */ + public TaskRunsClient getTaskRuns() { + return this.taskRuns; + } + + /** + * The TasksClient object to access its operations. + */ + private final TasksClient tasks; + + /** + * Gets the TasksClient object to access its operations. + * + * @return the TasksClient object. + */ + public TasksClient getTasks() { + return this.tasks; + } + + /** + * Initializes an instance of ContainerRegistryTasksManagementClient 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 Microsoft Azure subscription ID. + * @param endpoint server parameter. + */ + ContainerRegistryTasksManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + super(httpPipeline, serializerAdapter, environment); + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2019-06-01-preview"; + this.agentPools = new AgentPoolsClientImpl(this); + this.registryTasks = new RegistryTasksClientImpl(this); + this.runs = new RunsClientImpl(this); + this.taskRuns = new TaskRunsClientImpl(this); + this.tasks = new TasksClientImpl(this); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CredentialSetsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CredentialSetsClientImpl.java index 97292d224f85..181e135587d3 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CredentialSetsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CredentialSetsClientImpl.java @@ -70,7 +70,7 @@ public final class CredentialSetsClientImpl implements CredentialSetsClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientCredentialSets") public interface CredentialSetsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/credentialSets") @@ -159,11 +159,10 @@ private Mono> listSinglePageAsync(String resou if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -199,12 +198,11 @@ private Mono> listSinglePageAsync(String resou if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -311,11 +309,10 @@ public Mono> getWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, credentialSetName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, credentialSetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -354,11 +351,10 @@ private Mono> getWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, credentialSetName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, credentialSetName, accept, context); } /** @@ -453,12 +449,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { credentialSetCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, credentialSetName, + credentialSetCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -504,11 +499,10 @@ private Mono>> createWithResponseAsync(String resource } else { credentialSetCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, credentialSetName, credentialSetCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters, accept, context); } /** @@ -715,10 +709,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, credentialSetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -757,11 +750,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, credentialSetName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, credentialSetName, accept, context); } /** @@ -949,12 +941,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { credentialSetUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, credentialSetName, + credentialSetUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1000,11 +991,10 @@ private Mono>> updateWithResponseAsync(String resource } else { credentialSetUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, credentialSetName, credentialSetUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java index 83c09c2e2534..d73867ccd5ee 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java @@ -60,7 +60,7 @@ public final class OperationsClientImpl implements OperationsClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.ContainerRegistry/operations") @@ -91,9 +91,10 @@ private Mono> listSinglePageAsync() { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + 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())); @@ -115,10 +116,9 @@ private Mono> listSinglePageAsync(Contex return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, 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)); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/PrivateEndpointConnectionsClientImpl.java index 783f0eda55b2..3fd640522fb4 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/PrivateEndpointConnectionsClientImpl.java @@ -68,7 +68,7 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi * used by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientPrivateEndpointConnections") public interface PrivateEndpointConnectionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections") @@ -147,11 +147,10 @@ private Mono> listSinglePageAsync( if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -187,12 +186,11 @@ private Mono> listSinglePageAsync( if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -301,11 +299,11 @@ public Mono> getWithResponseAsync(Strin return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, privateEndpointConnectionName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -344,11 +342,10 @@ private Mono> getWithResponseAsync(Stri return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, privateEndpointConnectionName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, privateEndpointConnectionName, accept, context); } /** @@ -448,10 +445,9 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { privateEndpointConnection.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -500,11 +496,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { privateEndpointConnection.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, + privateEndpointConnection, accept, context); } /** @@ -719,11 +715,8 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, privateEndpointConnectionName, context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -761,10 +754,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, privateEndpointConnectionName, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, privateEndpointConnectionName, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java index d3e73cd1e17c..710938a6d392 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java @@ -40,8 +40,6 @@ import com.azure.resourcemanager.containerregistry.fluent.models.RegistryListCredentialsResultInner; import com.azure.resourcemanager.containerregistry.fluent.models.RegistryNameStatusInner; import com.azure.resourcemanager.containerregistry.fluent.models.RegistryUsageListResultInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; import com.azure.resourcemanager.containerregistry.models.GenerateCredentialsParameters; import com.azure.resourcemanager.containerregistry.models.ImportImageParameters; import com.azure.resourcemanager.containerregistry.models.PrivateLinkResourceListResult; @@ -49,7 +47,6 @@ import com.azure.resourcemanager.containerregistry.models.RegistryListResult; import com.azure.resourcemanager.containerregistry.models.RegistryNameCheckRequest; import com.azure.resourcemanager.containerregistry.models.RegistryUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.RunRequest; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; @@ -88,7 +85,7 @@ public final class RegistriesClientImpl implements InnerSupportsGet>> generateCredentials(@HostParam("$host") String @BodyParam("application/json") GenerateCredentialsParameters generateCredentialsParameters, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> scheduleRun(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") RunRequest runRequest, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuildSourceUploadUrl(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -296,9 +274,8 @@ public Mono>> importImageWithResponseAsync(String reso } else { parameters.validate(); } - final String apiVersion = "2025-04-01"; return FluxUtil - .withContext(context -> service.importImage(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.importImage(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -338,10 +315,9 @@ private Mono>> importImageWithResponseAsync(String res } else { parameters.validate(); } - final String apiVersion = "2025-04-01"; context = this.client.mergeContext(context); - return service.importImage(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, parameters, context); + return service.importImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, parameters, context); } /** @@ -518,11 +494,11 @@ public void importImage(String resourceGroupName, String registryName, ImportIma } else { registryNameCheckRequest.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), registryNameCheckRequest, accept, context)) + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), registryNameCheckRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -555,11 +531,10 @@ public void importImage(String resourceGroupName, String registryName, ImportIma } else { registryNameCheckRequest.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - registryNameCheckRequest, accept, context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), registryNameCheckRequest, accept, context); } /** @@ -630,11 +605,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -660,10 +634,11 @@ private Mono> listSinglePageAsync(Context context) return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -745,10 +720,9 @@ private Mono> listByResourceGroupSinglePageAsync(St return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -781,12 +755,11 @@ private Mono> listByResourceGroupSinglePageAsync(St return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -880,10 +853,9 @@ public Mono> getByResourceGroupWithResponseAsync(String if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -918,11 +890,10 @@ private Mono> getByResourceGroupWithResponseAsync(String if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context); } /** @@ -1008,10 +979,9 @@ public Mono>> createWithResponseAsync(String resourceG } else { registry.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, registry, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1052,11 +1022,10 @@ private Mono>> createWithResponseAsync(String resource } else { registry.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, registry, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, registry, accept, context); } /** @@ -1232,9 +1201,8 @@ public Mono>> deleteWithResponseAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1268,10 +1236,9 @@ private Mono>> deleteWithResponseAsync(String resource if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, context); } /** @@ -1440,12 +1407,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { registryUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, registryUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, registryUpdateParameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1486,11 +1452,10 @@ private Mono>> updateWithResponseAsync(String resource } else { registryUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, registryUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, registryUpdateParameters, accept, context); } /** @@ -1672,10 +1637,9 @@ public Mono> listUsagesWithResponseAsync( if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listUsages(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1710,11 +1674,10 @@ private Mono> listUsagesWithResponseAsync if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listUsages(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context); + return service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context); } /** @@ -1794,11 +1757,11 @@ public RegistryUsageListResultInner listUsages(String resourceGroupName, String if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listPrivateLinkResources(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) + .withContext( + context -> service.listPrivateLinkResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -1834,12 +1797,11 @@ public RegistryUsageListResultInner listUsages(String resourceGroupName, String if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listPrivateLinkResources(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context) + .listPrivateLinkResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1949,11 +1911,11 @@ public Mono> getPrivateLinkResourceWithRespon if (groupName == null) { return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getPrivateLinkResource(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, registryName, groupName, accept, context)) + .withContext( + context -> service.getPrivateLinkResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, groupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1991,11 +1953,10 @@ private Mono> getPrivateLinkResourceWithRespo if (groupName == null) { return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getPrivateLinkResource(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, groupName, accept, context); + return service.getPrivateLinkResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, groupName, accept, context); } /** @@ -2081,10 +2042,9 @@ public Mono> listCredentialsWithRes if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listCredentials(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listCredentials(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2119,11 +2079,10 @@ public Mono> listCredentialsWithRes if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listCredentials(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context); + return service.listCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context); } /** @@ -2212,10 +2171,9 @@ public Mono> regenerateCredentialWi } else { regenerateCredentialParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.regenerateCredential(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.regenerateCredential(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, regenerateCredentialParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -2260,11 +2218,11 @@ private Mono> regenerateCredentialW } else { regenerateCredentialParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.regenerateCredential(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, regenerateCredentialParameters, accept, context); + return service.regenerateCredential(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, regenerateCredentialParameters, accept, + context); } /** @@ -2361,10 +2319,9 @@ public Mono>> generateCredentialsWithResponseAsync(Str } else { generateCredentialsParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.generateCredentials(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.generateCredentials(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, generateCredentialsParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -2407,11 +2364,11 @@ private Mono>> generateCredentialsWithResponseAsync(St } else { generateCredentialsParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.generateCredentials(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, generateCredentialsParameters, accept, context); + return service.generateCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, generateCredentialsParameters, accept, + context); } /** @@ -2574,360 +2531,6 @@ public GenerateCredentialsResultInner generateCredentials(String resourceGroupNa .block(); } - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); - } else { - runRequest.validate(); - } - final String apiVersion = "2019-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); - } else { - runRequest.validate(); - } - final String apiVersion = "2019-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, runRequest, accept, context); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, - String registryName, RunRequest runRequest) { - Mono>> mono - = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, - RunInner.class, this.client.getContext()); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, - String registryName, RunRequest runRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, - RunInner.class, context); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest) { - return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest).getSyncPoller(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest, Context context) { - return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).getSyncPoller(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, - Context context) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { - return scheduleRunAsync(resourceGroupName, registryName, runRequest).block(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context) { - return scheduleRunAsync(resourceGroupName, registryName, runRequest, context).block(); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBuildSourceUploadUrl(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, registryName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, accept, context); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBuildSourceUploadUrlAsync(String resourceGroupName, - String registryName) { - return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, - String registryName, Context context) { - return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, context).block(); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { - return getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); - } - /** * Get the next page of items. * diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java index bfbf3b9211fd..2867b40f313b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java @@ -162,8 +162,8 @@ public SourceUploadDefinition getBuildSourceUploadUrl(String rgName, String acrN @Override public Mono getBuildSourceUploadUrlAsync(String rgName, String acrName) { return this.manager() - .serviceClient() - .getRegistries() + .taskClient() + .getRegistryTasks() .getBuildSourceUploadUrlAsync(rgName, acrName) .map(sourceUploadDefinitionInner -> new SourceUploadDefinitionImpl(sourceUploadDefinitionInner)); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java index b6d4bb69378e..5f685c119992 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java @@ -249,8 +249,8 @@ public SourceUploadDefinition getBuildSourceUploadUrl() { @Override public Mono getBuildSourceUploadUrlAsync() { return this.manager() - .serviceClient() - .getRegistries() + .taskClient() + .getRegistryTasks() .getBuildSourceUploadUrlAsync(this.resourceGroupName(), this.name()) .map(sourceUploadDefinitionInner -> new SourceUploadDefinitionImpl(sourceUploadDefinitionInner)); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java index 9085bbb22681..3ca87965c994 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java @@ -178,14 +178,14 @@ public Map sourceTriggers() { } RegistryTaskImpl(ContainerRegistryManager registryManager, String taskName) { - this.tasksInner = registryManager.serviceClient().getTasks(); + this.tasksInner = registryManager.taskClient().getTasks(); this.taskName = taskName; this.inner = new TaskInner(); this.taskUpdateParameters = new TaskUpdateParameters(); } RegistryTaskImpl(ContainerRegistryManager registryManager, TaskInner inner) { - this.tasksInner = registryManager.serviceClient().getTasks(); + this.tasksInner = registryManager.taskClient().getTasks(); this.taskName = inner.name(); this.inner = inner; this.resourceGroupName = ResourceUtils.groupFromResourceId(this.inner.id()); diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java index 74f6dd2c2440..a34acde54663 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java @@ -4,7 +4,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; +import com.azure.resourcemanager.containerregistry.fluent.RegistryTasksClient; import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; import com.azure.resourcemanager.containerregistry.models.AgentProperties; import com.azure.resourcemanager.containerregistry.models.Architecture; @@ -40,7 +40,7 @@ class RegistryTaskRunImpl implements RegistryTaskRun, RegistryTaskRun.Definition private String resourceGroupName; private String registryName; private RunInner inner; - private RegistriesClient registriesInner; + private RegistryTasksClient registriesInner; private FileTaskRunRequest fileTaskRunRequest; private EncodedTaskRunRequest encodedTaskRunRequest; private DockerBuildRequest dockerTaskRunRequest; @@ -116,7 +116,7 @@ public String runId() { RegistryTaskRunImpl(ContainerRegistryManager registryManager, RunInner runInner) { this.registryManager = registryManager; - this.registriesInner = registryManager.serviceClient().getRegistries(); + this.registriesInner = registryManager.taskClient().getRegistryTasks(); this.platform = new PlatformProperties(); this.inner = runInner; @@ -365,7 +365,7 @@ public RegistryTaskRun refresh() { @Override public Mono refreshAsync() { final RegistryTaskRunImpl self = this; - return registryManager.serviceClient() + return registryManager.taskClient() .getRuns() .getAsync(this.resourceGroupName(), this.registryName(), this.inner.runId()) .map(runInner -> { diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java index ce17ba64d1dc..575d5d6310dd 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java @@ -26,7 +26,7 @@ public RegistryTaskRun.DefinitionStages.BlankFromRuns scheduleRun() { @Override public PagedFlux listByRegistryAsync(String rgName, String acrName) { - return PagedConverter.mapPage(this.registryManager.serviceClient().getRuns().listAsync(rgName, acrName), + return PagedConverter.mapPage(this.registryManager.taskClient().getRuns().listAsync(rgName, acrName), inner -> wrapModel(inner)); } @@ -37,7 +37,7 @@ public PagedIterable listByRegistry(String rgName, String acrNa @Override public Mono getLogSasUrlAsync(String rgName, String acrName, String runId) { - return this.registryManager.serviceClient() + return this.registryManager.taskClient() .getRuns() .getLogSasUrlAsync(rgName, acrName, runId) .map(runGetLogResultInner -> runGetLogResultInner.logLink()); @@ -50,7 +50,7 @@ public String getLogSasUrl(String rgName, String acrName, String runId) { @Override public Mono cancelAsync(String rgName, String acrName, String runId) { - return this.registryManager.serviceClient().getRuns().cancelAsync(rgName, acrName, runId); + return this.registryManager.taskClient().getRuns().cancelAsync(rgName, acrName, runId); } @Override diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java new file mode 100644 index 000000000000..46f1d4a0b149 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.containerregistry.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +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.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.fluent.RegistryTasksClient; +import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; +import com.azure.resourcemanager.containerregistry.models.RunRequest; +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 RegistryTasksClient. + */ +public final class RegistryTasksClientImpl implements RegistryTasksClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryTasksService service; + + /** + * The service client containing this operation class. + */ + private final ContainerRegistryTasksManagementClientImpl client; + + /** + * Initializes an instance of RegistryTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryTasksClientImpl(ContainerRegistryTasksManagementClientImpl client) { + this.service + = RestProxy.create(RegistryTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryTasksManagementClientRegistryTasks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientRegistryTasks") + public interface RegistryTasksService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> scheduleRun(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") RunRequest runRequest, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuildSourceUploadUrl(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); + } else { + runRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), runRequest, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); + } else { + runRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), runRequest, accept, context); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, + String registryName, RunRequest runRequest) { + Mono>> mono + = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, + RunInner.class, this.client.getContext()); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, + String registryName, RunRequest runRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, + RunInner.class, context); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, + RunRequest runRequest) { + return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest).getSyncPoller(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, + RunRequest runRequest, Context context) { + return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).getSyncPoller(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + return beginScheduleRunAsync(resourceGroupName, registryName, runRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, + Context context) { + return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunAsync(resourceGroupName, registryName, runRequest).block(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + return scheduleRunAsync(resourceGroupName, registryName, runRequest, context).block(); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName, Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), accept, context); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getBuildSourceUploadUrlAsync(String resourceGroupName, + String registryName) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, + String registryName, Context context) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java index 573db6b801cd..acee3739c8ad 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java @@ -29,7 +29,7 @@ public RegistryTask.DefinitionStages.Blank define(String name) { @Override public PagedFlux listByRegistryAsync(String resourceGroupName, String registryName) { return PagedConverter.mapPage( - this.registryManager.serviceClient().getTasks().listAsync(resourceGroupName, registryName), + this.registryManager.taskClient().getTasks().listAsync(resourceGroupName, registryName), inner -> wrapModel(inner)); } @@ -42,12 +42,12 @@ public PagedIterable listByRegistry(String resourceGroupName, Stri public Mono getByRegistryAsync(String resourceGroupName, String registryName, String taskName, boolean includeSecrets) { if (includeSecrets) { - return this.registryManager.serviceClient() + return this.registryManager.taskClient() .getTasks() .getDetailsAsync(resourceGroupName, registryName, taskName) .map(taskInner -> new RegistryTaskImpl(registryManager, taskInner)); } else { - return this.registryManager.serviceClient() + return this.registryManager.taskClient() .getTasks() .getAsync(resourceGroupName, registryName, taskName) .map(taskInner -> new RegistryTaskImpl(registryManager, taskInner)); @@ -62,7 +62,7 @@ public RegistryTask getByRegistry(String resourceGroupName, String registryName, @Override public Mono deleteByRegistryAsync(String resourceGroupName, String registryName, String taskName) { - return this.registryManager.serviceClient().getTasks().deleteAsync(resourceGroupName, registryName, taskName); + return this.registryManager.taskClient().getTasks().deleteAsync(resourceGroupName, registryName, taskName); } @Override @@ -75,6 +75,6 @@ private RegistryTaskImpl wrapModel(TaskInner innerModel) { } public TasksClient inner() { - return this.registryManager.serviceClient().getTasks(); + return this.registryManager.taskClient().getTasks(); } } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java index c26ae7a56549..88076ab78da3 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java @@ -70,7 +70,7 @@ public final class ReplicationsClientImpl implements ReplicationsClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientReplications") public interface ReplicationsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications") @@ -158,11 +158,10 @@ private Mono> listSinglePageAsync(String resourc if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -198,12 +197,11 @@ private Mono> listSinglePageAsync(String resourc if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -310,11 +308,10 @@ public Mono> getWithResponseAsync(String resourceGrou return Mono .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, replicationName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -353,11 +350,10 @@ private Mono> getWithResponseAsync(String resourceGro return Mono .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, replicationName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, replicationName, accept, context); } /** @@ -451,12 +447,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { replication.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, replicationName, replication, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, replication, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -501,11 +496,10 @@ private Mono>> createWithResponseAsync(String resource } else { replication.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, replicationName, replication, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, replicationName, replication, accept, context); } /** @@ -701,9 +695,8 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -742,10 +735,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, replicationName, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, replicationName, context); } /** @@ -933,12 +925,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { replicationUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, replicationName, replicationUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, + replicationUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -984,11 +975,10 @@ private Mono>> updateWithResponseAsync(String resource } else { replicationUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, replicationName, replicationUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, replicationName, replicationUpdateParameters, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java index 70f12491b96f..fc87f769665d 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java @@ -52,24 +52,24 @@ public final class RunsClientImpl implements RunsClient { /** * The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; + private final ContainerRegistryTasksManagementClientImpl client; /** * Initializes an instance of RunsClientImpl. * * @param client the instance of the service client containing this operation class. */ - RunsClientImpl(ContainerRegistryManagementClientImpl client) { + RunsClientImpl(ContainerRegistryTasksManagementClientImpl client) { this.service = RestProxy.create(RunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ContainerRegistryManagementClientRuns to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for ContainerRegistryTasksManagementClientRuns to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientRuns") public interface RunsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs") @@ -161,11 +161,10 @@ private Mono> listSinglePageAsync(String resourceGroupNa if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, filter, top, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), filter, top, 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())); @@ -203,12 +202,11 @@ private Mono> listSinglePageAsync(String resourceGroupNa if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, filter, top, accept, context) + this.client.getApiVersion(), filter, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -340,11 +338,10 @@ public Mono> getWithResponseAsync(String resourceGroupName, S if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runId, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -382,11 +379,10 @@ private Mono> getWithResponseAsync(String resourceGroupName, if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, runId, accept, context); + this.client.getApiVersion(), runId, accept, context); } /** @@ -479,11 +475,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { runUpdateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runId, runUpdateParameters, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), runId, runUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -527,11 +523,10 @@ private Mono>> updateWithResponseAsync(String resource } else { runUpdateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, runId, runUpdateParameters, accept, context); + registryName, this.client.getApiVersion(), runId, runUpdateParameters, accept, context); } /** @@ -724,11 +719,10 @@ public Mono> getLogSasUrlWithResponseAsync(String if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getLogSasUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runId, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -765,11 +759,10 @@ private Mono> getLogSasUrlWithResponseAsync(Strin if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getLogSasUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, runId, accept, context); + registryName, this.client.getApiVersion(), runId, accept, context); } /** @@ -855,11 +848,10 @@ public Mono>> cancelWithResponseAsync(String resourceG if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runId, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -896,11 +888,10 @@ private Mono>> cancelWithResponseAsync(String resource if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, runId, accept, context); + registryName, this.client.getApiVersion(), runId, accept, context); } /** @@ -1051,7 +1042,7 @@ public void cancel(String resourceGroupName, String registryName, String runId, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of runs along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all the runs for a registry along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1077,7 +1068,7 @@ private Mono> listNextSinglePageAsync(String nextLink) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return collection of runs along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return all the runs for a registry along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ScopeMapsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ScopeMapsClientImpl.java index 434b5dd02787..3f8f976a63bb 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ScopeMapsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ScopeMapsClientImpl.java @@ -70,7 +70,7 @@ public final class ScopeMapsClientImpl implements ScopeMapsClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientScopeMaps") public interface ScopeMapsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps") @@ -157,11 +157,10 @@ private Mono> listSinglePageAsync(String resourceGr if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -197,12 +196,11 @@ private Mono> listSinglePageAsync(String resourceGr if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -308,11 +306,10 @@ public Mono> getWithResponseAsync(String resourceGroupNa if (scopeMapName == null) { return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, scopeMapName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, scopeMapName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -350,11 +347,10 @@ private Mono> getWithResponseAsync(String resourceGroupN if (scopeMapName == null) { return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, scopeMapName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, scopeMapName, accept, context); } /** @@ -448,12 +444,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { scopeMapCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, scopeMapName, + scopeMapCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -498,11 +493,10 @@ private Mono>> createWithResponseAsync(String resource } else { scopeMapCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, scopeMapName, scopeMapCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, accept, context); } /** @@ -696,10 +690,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (scopeMapName == null) { return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, scopeMapName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -737,11 +730,10 @@ private Mono>> deleteWithResponseAsync(String resource if (scopeMapName == null) { return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, scopeMapName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, scopeMapName, accept, context); } /** @@ -927,12 +919,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { scopeMapUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, scopeMapName, + scopeMapUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -977,11 +968,10 @@ private Mono>> updateWithResponseAsync(String resource } else { scopeMapUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, scopeMapName, scopeMapUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java index fdf25d300a26..bcdbf2250c24 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java @@ -53,24 +53,24 @@ public final class TaskRunsClientImpl implements TaskRunsClient { /** * The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; + private final ContainerRegistryTasksManagementClientImpl client; /** * Initializes an instance of TaskRunsClientImpl. * * @param client the instance of the service client containing this operation class. */ - TaskRunsClientImpl(ContainerRegistryManagementClientImpl client) { + TaskRunsClientImpl(ContainerRegistryTasksManagementClientImpl client) { this.service = RestProxy.create(TaskRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ContainerRegistryManagementClientTaskRuns to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for ContainerRegistryTasksManagementClientTaskRuns to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientTaskRuns") public interface TaskRunsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") @@ -173,11 +173,10 @@ public Mono> getWithResponseAsync(String resourceGroupNam if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -215,11 +214,10 @@ private Mono> getWithResponseAsync(String resourceGroupNa if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, taskRunName, accept, context); + this.client.getApiVersion(), taskRunName, accept, context); } /** @@ -312,11 +310,10 @@ public Mono>> createWithResponseAsync(String resourceG } else { taskRun.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, taskRun, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, taskRun, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -360,11 +357,10 @@ private Mono>> createWithResponseAsync(String resource } else { taskRun.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskRunName, taskRun, accept, context); + registryName, this.client.getApiVersion(), taskRunName, taskRun, accept, context); } /** @@ -556,11 +552,10 @@ public Mono>> deleteWithResponseAsync(String resourceG if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -597,11 +592,10 @@ private Mono>> deleteWithResponseAsync(String resource if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskRunName, accept, context); + registryName, this.client.getApiVersion(), taskRunName, accept, context); } /** @@ -786,11 +780,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { updateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, updateParameters, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), taskRunName, updateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -835,11 +829,10 @@ private Mono>> updateWithResponseAsync(String resource } else { updateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskRunName, updateParameters, accept, context); + registryName, this.client.getApiVersion(), taskRunName, updateParameters, accept, context); } /** @@ -1033,11 +1026,10 @@ public Mono> getDetailsWithResponseAsync(String resourceG if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1075,11 +1067,10 @@ private Mono> getDetailsWithResponseAsync(String resource if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskRunName, accept, context); + registryName, this.client.getApiVersion(), taskRunName, accept, context); } /** @@ -1161,11 +1152,10 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, accept, context)) + resourceGroupName, registryName, 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())); @@ -1200,12 +1190,11 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, accept, context) + this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java index 5349aafd284f..01e816dd67c2 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java @@ -53,24 +53,24 @@ public final class TasksClientImpl implements TasksClient { /** * The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; + private final ContainerRegistryTasksManagementClientImpl client; /** * Initializes an instance of TasksClientImpl. * * @param client the instance of the service client containing this operation class. */ - TasksClientImpl(ContainerRegistryManagementClientImpl client) { + TasksClientImpl(ContainerRegistryTasksManagementClientImpl client) { this.service = RestProxy.create(TasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ContainerRegistryManagementClientTasks to be used by the proxy + * The interface defining all the services for ContainerRegistryTasksManagementClientTasks to be used by the proxy * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientTasks") public interface TasksService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks") @@ -168,11 +168,10 @@ private Mono> listSinglePageAsync(String resourceGroupN if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, accept, context)) + resourceGroupName, registryName, 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())); @@ -207,12 +206,11 @@ private Mono> listSinglePageAsync(String resourceGroupN if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, accept, context) + this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -313,11 +311,10 @@ public Mono> getWithResponseAsync(String resourceGroupName, if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -354,11 +351,10 @@ private Mono> getWithResponseAsync(String resourceGroupName, if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, taskName, accept, context); + this.client.getApiVersion(), taskName, accept, context); } /** @@ -452,11 +448,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { taskCreateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, taskCreateParameters, accept, context)) + .withContext( + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), taskName, taskCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -501,11 +497,10 @@ private Mono>> createWithResponseAsync(String resource } else { taskCreateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskName, taskCreateParameters, accept, context); + registryName, this.client.getApiVersion(), taskName, taskCreateParameters, accept, context); } /** @@ -698,11 +693,10 @@ public Mono>> deleteWithResponseAsync(String resourceG if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -739,11 +733,10 @@ private Mono>> deleteWithResponseAsync(String resource if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskName, accept, context); + registryName, this.client.getApiVersion(), taskName, accept, context); } /** @@ -928,11 +921,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { taskUpdateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, taskUpdateParameters, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), taskName, taskUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -977,11 +970,10 @@ private Mono>> updateWithResponseAsync(String resource } else { taskUpdateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskName, taskUpdateParameters, accept, context); + registryName, this.client.getApiVersion(), taskName, taskUpdateParameters, accept, context); } /** @@ -1175,11 +1167,10 @@ public Mono> getDetailsWithResponseAsync(String resourceGrou if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1217,11 +1208,10 @@ private Mono> getDetailsWithResponseAsync(String resourceGro if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskName, accept, context); + registryName, this.client.getApiVersion(), taskName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TokensClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TokensClientImpl.java index 2a829a8136fc..3a56d4919701 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TokensClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TokensClientImpl.java @@ -69,7 +69,7 @@ public final class TokensClientImpl implements TokensClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientTokens") public interface TokensService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens") @@ -155,11 +155,10 @@ private Mono> listSinglePageAsync(String resourceGroup if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -195,12 +194,11 @@ private Mono> listSinglePageAsync(String resourceGroup if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -306,11 +304,10 @@ public Mono> getWithResponseAsync(String resourceGroupName, if (tokenName == null) { return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, tokenName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, tokenName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -348,11 +345,10 @@ private Mono> getWithResponseAsync(String resourceGroupName if (tokenName == null) { return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, tokenName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, tokenName, accept, context); } /** @@ -446,12 +442,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { tokenCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, tokenName, tokenCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, tokenName, tokenCreateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -496,11 +491,10 @@ private Mono>> createWithResponseAsync(String resource } else { tokenCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, tokenName, tokenCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, tokenName, tokenCreateParameters, accept, context); } /** @@ -693,10 +687,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (tokenName == null) { return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, tokenName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -734,11 +727,10 @@ private Mono>> deleteWithResponseAsync(String resource if (tokenName == null) { return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, tokenName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, tokenName, accept, context); } /** @@ -923,12 +915,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { tokenUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, tokenName, tokenUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, tokenName, tokenUpdateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -973,11 +964,10 @@ private Mono>> updateWithResponseAsync(String resource } else { tokenUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, tokenName, tokenUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, tokenName, tokenUpdateParameters, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java index 779e667f8761..2c7e26850049 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java @@ -75,7 +75,7 @@ public final class WebhooksClientImpl implements WebhooksClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryMan") + @ServiceInterface(name = "ContainerRegistryManagementClientWebhooks") public interface WebhooksService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks") @@ -196,11 +196,10 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -236,12 +235,11 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -347,11 +345,10 @@ public Mono> getWithResponseAsync(String resourceGroupNam if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -389,11 +386,10 @@ private Mono> getWithResponseAsync(String resourceGroupNa if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, accept, context); } /** @@ -487,12 +483,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { webhookCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, webhookCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, webhookCreateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -537,11 +532,10 @@ private Mono>> createWithResponseAsync(String resource } else { webhookCreateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, webhookCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, webhookCreateParameters, accept, context); } /** @@ -735,9 +729,8 @@ public Mono>> deleteWithResponseAsync(String resourceG if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -775,10 +768,9 @@ private Mono>> deleteWithResponseAsync(String resource if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, context); } /** @@ -963,12 +955,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { webhookUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, webhookUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, webhookUpdateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1013,11 +1004,10 @@ private Mono>> updateWithResponseAsync(String resource } else { webhookUpdateParameters.validate(); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, webhookUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, webhookUpdateParameters, accept, context); } /** @@ -1211,11 +1201,10 @@ public Mono> pingWithResponseAsync(String resourceGroup if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.ping(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, accept, context)) + .withContext(context -> service.ping(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1252,11 +1241,10 @@ private Mono> pingWithResponseAsync(String resourceGrou if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.ping(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, accept, context); + return service.ping(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, accept, context); } /** @@ -1343,10 +1331,9 @@ private Mono> listEventsSinglePageAsync(String resourc if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listEvents(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listEvents(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1387,12 +1374,11 @@ private Mono> listEventsSinglePageAsync(String resourc if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listEvents(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, accept, context) + .listEvents(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1500,10 +1486,9 @@ public Mono> getCallbackConfigWithResponseAsync(St if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getCallbackConfig(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.getCallbackConfig(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1542,11 +1527,10 @@ private Mono> getCallbackConfigWithResponseAsync(S if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-04-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getCallbackConfig(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, accept, context); + return service.getCallbackConfig(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java index 327e344409f9..2b63c5fea590 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java @@ -55,6 +55,17 @@ public String principalId() { return this.principalId; } + /** + * Set the principalId property: The principal ID of resource identity. + * + * @param principalId the principalId value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + /** * Get the tenantId property: The tenant ID of resource. * @@ -64,6 +75,17 @@ public String tenantId() { return this.tenantId; } + /** + * Set the tenantId property: The tenant ID of resource. + * + * @param tenantId the tenantId value to set. + * @return the IdentityProperties object itself. + */ + public IdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + /** * Get the type property: The identity type. * @@ -133,6 +155,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("tenantId", this.tenantId); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, (writer, element) -> writer.writeJson(element)); diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java index 289cfc3ae70d..3799b9be1c3d 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java @@ -161,12 +161,12 @@ public static TaskStepProperties fromJson(JsonReader jsonReader) throws IOExcept } } // Use the discriminator value to determine which subtype should be deserialized. - if ("FileTask".equals(discriminatorValue)) { + if ("Docker".equals(discriminatorValue)) { + return DockerTaskStep.fromJson(readerToUse.reset()); + } else if ("FileTask".equals(discriminatorValue)) { return FileTaskStep.fromJson(readerToUse.reset()); } else if ("EncodedTask".equals(discriminatorValue)) { return EncodedTaskStep.fromJson(readerToUse.reset()); - } else if ("Docker".equals(discriminatorValue)) { - return DockerTaskStep.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UserIdentityProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UserIdentityProperties.java index 99ed6e3e07de..2f74459db428 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UserIdentityProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UserIdentityProperties.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.containerregistry.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The UserIdentityProperties model. */ -@Immutable +@Fluent public final class UserIdentityProperties implements JsonSerializable { /* * The principal id of user assigned identity. @@ -41,6 +41,17 @@ public String principalId() { return this.principalId; } + /** + * Set the principalId property: The principal id of user assigned identity. + * + * @param principalId the principalId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + /** * Get the clientId property: The client id of user assigned identity. * @@ -50,6 +61,17 @@ public String clientId() { return this.clientId; } + /** + * Set the clientId property: The client id of user assigned identity. + * + * @param clientId the clientId value to set. + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + /** * Validates the instance. * @@ -64,6 +86,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("principalId", this.principalId); + jsonWriter.writeStringField("clientId", this.clientId); return jsonWriter.writeEndObject(); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java index 7f57596e0266..5f1698ec58e9 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the data models for ContainerRegistryManagementClient. + * Package containing the data models for ContainerRegistryTasksManagementClient. * null. */ package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java index a0d6cac29602..5a77c65cbf4b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java @@ -3,7 +3,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * Package containing the classes for ContainerRegistryManagementClient. + * Package containing the classes for ContainerRegistryTasksManagementClient. * null. */ package com.azure.resourcemanager.containerregistry; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json index a0b8e920e049..b056823a26c0 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.containerregistry.implementation.AgentPoolsClientImpl$AgentPoolsService"],["com.azure.resourcemanager.containerregistry.implementation.CacheRulesClientImpl$CacheRulesService"],["com.azure.resourcemanager.containerregistry.implementation.ConnectedRegistriesClientImpl$ConnectedRegistriesService"],["com.azure.resourcemanager.containerregistry.implementation.CredentialSetsClientImpl$CredentialSetsService"],["com.azure.resourcemanager.containerregistry.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.containerregistry.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.containerregistry.implementation.RegistriesClientImpl$RegistriesService"],["com.azure.resourcemanager.containerregistry.implementation.ReplicationsClientImpl$ReplicationsService"],["com.azure.resourcemanager.containerregistry.implementation.RunsClientImpl$RunsService"],["com.azure.resourcemanager.containerregistry.implementation.ScopeMapsClientImpl$ScopeMapsService"],["com.azure.resourcemanager.containerregistry.implementation.TaskRunsClientImpl$TaskRunsService"],["com.azure.resourcemanager.containerregistry.implementation.TasksClientImpl$TasksService"],["com.azure.resourcemanager.containerregistry.implementation.TokensClientImpl$TokensService"],["com.azure.resourcemanager.containerregistry.implementation.WebhooksClientImpl$WebhooksService"]] \ No newline at end of file +[["com.azure.resourcemanager.containerregistry.implementation.AgentPoolsClientImpl$AgentPoolsService"],["com.azure.resourcemanager.containerregistry.implementation.RegistryTasksClientImpl$RegistryTasksService"],["com.azure.resourcemanager.containerregistry.implementation.RunsClientImpl$RunsService"],["com.azure.resourcemanager.containerregistry.implementation.TaskRunsClientImpl$TaskRunsService"],["com.azure.resourcemanager.containerregistry.implementation.TasksClientImpl$TasksService"]] \ No newline at end of file diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java index 369773bb1316..d6300bb18622 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java @@ -1063,7 +1063,7 @@ public void cancelAndDeleteRunsAndTasks() { Assertions.assertTrue(registryManager.registryTaskRuns().listByRegistry(rgName, acrName).stream().count() == 1); // cancelling the run we just created - registryManager.serviceClient().getRuns().cancel(rgName, acrName, registryTaskRun.runId()); + registryManager.taskClient().getRuns().cancel(rgName, acrName, registryTaskRun.runId()); boolean notCanceled = true; while (notCanceled) { From eddeb44053e7a1d9f93a42daedea4f0be2d4178f Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 17 Oct 2025 13:07:25 +0800 Subject: [PATCH 3/4] suffix --- sdk/resourcemanager/api-specs.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index 4143d406002a..8bc6c4563ef9 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -64,7 +64,7 @@ "dir": "../containerregistry/azure-resourcemanager-containerregistry", "source": "specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/readme.md", "package": "com.azure.resourcemanager.containerregistry", - "args": "--tag=package-2019-06-preview --modelerfour.lenient-model-deduplication=true --enable-sync-stack=false" + "args": "--tag=package-2019-06-preview --modelerfour.lenient-model-deduplication=true --graalvm-config-suffix=registrytasks --enable-sync-stack=false" }, "containerregistry-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-containerregistry", From 5c199ae88543d9b6284837a9109a7a558e0442bc Mon Sep 17 00:00:00 2001 From: Weidong Xu Date: Fri, 17 Oct 2025 13:11:45 +0800 Subject: [PATCH 4/4] regen with latest api-version --- .../fluent/AgentPoolsClient.java | 330 ++++---- ...ontainerRegistryTasksManagementClient.java | 2 +- .../fluent/RegistryTasksClient.java | 134 +-- .../containerregistry/fluent/RunsClient.java | 240 ++---- .../fluent/TaskRunsClient.java | 334 ++++---- .../containerregistry/fluent/TasksClient.java | 335 +++----- .../fluent/models/AgentPoolInner.java | 4 +- .../fluent/models/RunInner.java | 4 +- .../fluent/models/TaskInner.java | 42 +- .../fluent/models/TaskRunInner.java | 44 +- .../fluent/models/package-info.java | 4 +- .../fluent/package-info.java | 4 +- .../implementation/AgentPoolsClientImpl.java | 782 +++++++++--------- ...rRegistryTasksManagementClientBuilder.java | 4 +- ...inerRegistryTasksManagementClientImpl.java | 8 +- .../RegistryTasksClientImpl.java | 278 ++----- .../implementation/RunsClientImpl.java | 488 ++++------- .../implementation/TaskRunsClientImpl.java | 751 ++++++++--------- .../implementation/TasksClientImpl.java | 693 +++++----------- .../models/IdentityProperties.java | 24 - .../models/RunListResult.java | 2 +- .../containerregistry/models/RunRequest.java | 4 +- .../models/SourceRegistryCredentials.java | 36 +- .../models/TaskStepProperties.java | 4 +- .../models/TaskStepUpdateParameters.java | 4 +- .../models/UserIdentityProperties.java | 28 +- .../models/package-info.java | 4 +- .../containerregistry/package-info.java | 4 +- .../proxy-config.json | 2 +- .../proxy-config.json | 1 + .../reflect-config.json | 1 + sdk/resourcemanager/api-specs.json | 2 +- 32 files changed, 1821 insertions(+), 2776 deletions(-) create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/proxy-config.json create mode 100644 sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/reflect-config.json diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/AgentPoolsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/AgentPoolsClient.java index 9b8455c76b7a..086018ec8c36 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/AgentPoolsClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/AgentPoolsClient.java @@ -24,11 +24,51 @@ * An instance of this class provides access to all the operations defined in AgentPoolsClient. */ public interface AgentPoolsClient { + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String registryName); + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -43,8 +83,8 @@ Mono> getWithResponseAsync(String resourceGroupName, St /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -57,8 +97,8 @@ Mono> getWithResponseAsync(String resourceGroupName, St /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -73,8 +113,8 @@ Response getWithResponse(String resourceGroupName, String regist /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -87,14 +127,15 @@ Response getWithResponse(String resourceGroupName, String regist /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties along with {@link Response} on successful + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -104,14 +145,15 @@ Mono>> createWithResponseAsync(String resourceGroupNam /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux, AgentPoolInner> beginCreateAsync(String resourceGroupName, @@ -120,14 +162,15 @@ PollerFlux, AgentPoolInner> beginCreateAsync(String r /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AgentPoolInner> beginCreate(String resourceGroupName, String registryName, @@ -136,8 +179,8 @@ SyncPoller, AgentPoolInner> beginCreate(String resour /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @param context The context to associate with this operation. @@ -145,6 +188,7 @@ SyncPoller, AgentPoolInner> beginCreate(String resour * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, AgentPoolInner> beginCreate(String resourceGroupName, String registryName, @@ -153,14 +197,15 @@ SyncPoller, AgentPoolInner> beginCreate(String resour /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono createAsync(String resourceGroupName, String registryName, String agentPoolName, @@ -169,14 +214,15 @@ Mono createAsync(String resourceGroupName, String registryName, /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.SINGLE) AgentPoolInner create(String resourceGroupName, String registryName, String agentPoolName, @@ -185,8 +231,8 @@ AgentPoolInner create(String resourceGroupName, String registryName, String agen /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @param context The context to associate with this operation. @@ -194,272 +240,240 @@ AgentPoolInner create(String resourceGroupName, String registryName, String agen * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.SINGLE) AgentPoolInner create(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool, Context context); /** - * Deletes a specified agent pool resource. + * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, - String agentPoolName); + Mono>> updateWithResponseAsync(String resourceGroupName, String registryName, + String agentPoolName, AgentPoolUpdateParameters updateParameters); /** - * Deletes a specified agent pool resource. + * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, - String agentPoolName); + PollerFlux, AgentPoolInner> beginUpdateAsync(String resourceGroupName, + String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters); /** - * Deletes a specified agent pool resource. + * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String agentPoolName); + SyncPoller, AgentPoolInner> beginUpdate(String resourceGroupName, String registryName, + String agentPoolName, AgentPoolUpdateParameters updateParameters); /** - * Deletes a specified agent pool resource. + * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String agentPoolName, - Context context); + SyncPoller, AgentPoolInner> beginUpdate(String resourceGroupName, String registryName, + String agentPoolName, AgentPoolUpdateParameters updateParameters, Context context); /** - * Deletes a specified agent pool resource. + * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String registryName, String agentPoolName); + Mono updateAsync(String resourceGroupName, String registryName, String agentPoolName, + AgentPoolUpdateParameters updateParameters); /** - * Deletes a specified agent pool resource. + * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String agentPoolName); + AgentPoolInner update(String resourceGroupName, String registryName, String agentPoolName, + AgentPoolUpdateParameters updateParameters); /** - * Deletes a specified agent pool resource. + * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String agentPoolName, Context context); + AgentPoolInner update(String resourceGroupName, String registryName, String agentPoolName, + AgentPoolUpdateParameters updateParameters, Context context); /** - * Updates an agent pool with the specified parameters. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. - * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync(String resourceGroupName, String registryName, - String agentPoolName, AgentPoolUpdateParameters updateParameters); + Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String agentPoolName); /** - * Updates an agent pool with the specified parameters. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. - * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, AgentPoolInner> beginUpdateAsync(String resourceGroupName, - String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters); + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String agentPoolName); /** - * Updates an agent pool with the specified parameters. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. - * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AgentPoolInner> beginUpdate(String resourceGroupName, String registryName, - String agentPoolName, AgentPoolUpdateParameters updateParameters); + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String agentPoolName); /** - * Updates an agent pool with the specified parameters. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. - * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, AgentPoolInner> beginUpdate(String resourceGroupName, String registryName, - String agentPoolName, AgentPoolUpdateParameters updateParameters, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String agentPoolName, + Context context); /** - * Updates an agent pool with the specified parameters. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. - * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String registryName, String agentPoolName, - AgentPoolUpdateParameters updateParameters); + Mono deleteAsync(String resourceGroupName, String registryName, String agentPoolName); /** - * Updates an agent pool with the specified parameters. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. - * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolInner update(String resourceGroupName, String registryName, String agentPoolName, - AgentPoolUpdateParameters updateParameters); + void delete(String resourceGroupName, String registryName, String agentPoolName); /** - * Updates an agent pool with the specified parameters. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. - * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - AgentPoolInner update(String resourceGroupName, String registryName, String agentPoolName, - AgentPoolUpdateParameters updateParameters, Context context); - - /** - * Lists all the agent pools for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String registryName); - - /** - * Lists all the agent pools for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName); - - /** - * Lists all the agent pools for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName, Context context); + void delete(String resourceGroupName, String registryName, String agentPoolName, Context context); /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -474,8 +488,8 @@ Mono> getQueueStatusWithResponseAsync(String /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -489,8 +503,8 @@ Mono getQueueStatusAsync(String resourceGroupName, St /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -505,8 +519,8 @@ Response getQueueStatusWithResponse(String resourceGr /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ContainerRegistryTasksManagementClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ContainerRegistryTasksManagementClient.java index 0c2479d19feb..c80378b4b3d4 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ContainerRegistryTasksManagementClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/ContainerRegistryTasksManagementClient.java @@ -12,7 +12,7 @@ */ public interface ContainerRegistryTasksManagementClient { /** - * Gets The Microsoft Azure subscription ID. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java index 5d75bd26481b..bb42f83b2946 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java @@ -7,15 +7,10 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; -import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; import com.azure.resourcemanager.containerregistry.models.RunRequest; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -23,163 +18,118 @@ */ public interface RegistryTasksClient { /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. + * @return the upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, String registryName, - RunRequest runRequest); + Mono> getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, + String registryName); /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. + * @return the upload location for the user to be able to upload the source on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest, Context context); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. + * @return the upload location for the user to be able to upload the source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); + Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, + String registryName, Context context); /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. + * @return the upload location for the user to be able to upload the source. */ @ServiceMethod(returns = ReturnType.SINGLE) - RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); + SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName); /** * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. + * @param runRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. + * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, - String registryName); + Mono> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest); /** - * Get the upload location for the user to be able to upload the source. + * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. + * @param runRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source on successful completion of - * {@link Mono}. + * @return run resource properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); + Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); /** - * Get the upload location for the user to be able to upload the source. + * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. + * @param runRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response}. + * @return run resource properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, - String registryName, Context context); + Response scheduleRunWithResponse(String resourceGroupName, String registryName, RunRequest runRequest, + Context context); /** - * Get the upload location for the user to be able to upload the source. + * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. + * @param runRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source. + * @return run resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName); + RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java index 229f30005c99..766f7df72bde 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java @@ -9,15 +9,10 @@ import com.azure.core.http.rest.PagedFlux; 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.PollerFlux; -import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.containerregistry.fluent.models.RunGetLogResultInner; import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; import com.azure.resourcemanager.containerregistry.models.RunUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -27,8 +22,8 @@ public interface RunsClient { /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. @@ -43,8 +38,8 @@ public interface RunsClient { /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -56,8 +51,8 @@ public interface RunsClient { /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -69,8 +64,8 @@ public interface RunsClient { /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. @@ -87,8 +82,8 @@ PagedIterable list(String resourceGroupName, String registryName, Stri /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -102,8 +97,8 @@ PagedIterable list(String resourceGroupName, String registryName, Stri /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -116,8 +111,8 @@ PagedIterable list(String resourceGroupName, String registryName, Stri /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -131,8 +126,8 @@ PagedIterable list(String resourceGroupName, String registryName, Stri /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -145,8 +140,8 @@ PagedIterable list(String resourceGroupName, String registryName, Stri /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -155,63 +150,14 @@ PagedIterable list(String resourceGroupName, String registryName, Stri * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync(String resourceGroupName, String registryName, - String runId, RunUpdateParameters runUpdateParameters); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, RunInner> beginUpdateAsync(String resourceGroupName, String registryName, - String runId, RunUpdateParameters runUpdateParameters); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginUpdate(String resourceGroupName, String registryName, String runId, + Mono> updateWithResponseAsync(String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters); /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginUpdate(String resourceGroupName, String registryName, String runId, - RunUpdateParameters runUpdateParameters, Context context); - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -226,27 +172,27 @@ Mono updateAsync(String resourceGroupName, String registryName, String /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. + * @return run resource properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - RunInner update(String resourceGroupName, String registryName, String runId, - RunUpdateParameters runUpdateParameters); + Response updateWithResponse(String resourceGroupName, String registryName, String runId, + RunUpdateParameters runUpdateParameters, Context context); /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -254,164 +200,120 @@ RunInner update(String resourceGroupName, String registryName, String runId, */ @ServiceMethod(returns = ReturnType.SINGLE) RunInner update(String resourceGroupName, String registryName, String runId, - RunUpdateParameters runUpdateParameters, Context context); + RunUpdateParameters runUpdateParameters); /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getLogSasUrlWithResponseAsync(String resourceGroupName, String registryName, - String runId); + Mono> cancelWithResponseAsync(String resourceGroupName, String registryName, String runId); /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getLogSasUrlAsync(String resourceGroupName, String registryName, String runId); + Mono cancelAsync(String resourceGroupName, String registryName, String runId); /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getLogSasUrlWithResponse(String resourceGroupName, String registryName, String runId, - Context context); + Response cancelWithResponse(String resourceGroupName, String registryName, String runId, Context context); /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a link to download the run logs. */ @ServiceMethod(returns = ReturnType.SINGLE) - RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId); + void cancel(String resourceGroupName, String registryName, String runId); /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run 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 {@link Response} on successful completion of {@link Mono}. + * @return a link to download the run logs along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> cancelWithResponseAsync(String resourceGroupName, String registryName, + Mono> getLogSasUrlWithResponseAsync(String resourceGroupName, String registryName, String runId); /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run 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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginCancelAsync(String resourceGroupName, String registryName, String runId); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run 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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId); - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId, - Context context); - - /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a link to download the run logs on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono cancelAsync(String resourceGroupName, String registryName, String runId); + Mono getLogSasUrlAsync(String resourceGroupName, String registryName, String runId); /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String registryName, String runId); + Response getLogSasUrlWithResponse(String resourceGroupName, String registryName, String runId, + Context context); /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return a link to download the run logs. */ @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String registryName, String runId, Context context); + RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TaskRunsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TaskRunsClient.java index 44919b70d17e..1679fb9235a3 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TaskRunsClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TaskRunsClient.java @@ -23,11 +23,51 @@ * An instance of this class provides access to all the operations defined in TaskRunsClient. */ public interface TaskRunsClient { + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String registryName); + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName); + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String registryName, Context context); + /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -42,8 +82,8 @@ Mono> getWithResponseAsync(String resourceGroupName, Stri /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -56,8 +96,8 @@ Mono> getWithResponseAsync(String resourceGroupName, Stri /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -72,8 +112,8 @@ Response getWithResponse(String resourceGroupName, String registry /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -86,14 +126,15 @@ Response getWithResponse(String resourceGroupName, String registry /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties along with {@link Response} on successful + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -103,14 +144,15 @@ Mono>> createWithResponseAsync(String resourceGroupNam /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux, TaskRunInner> beginCreateAsync(String resourceGroupName, String registryName, @@ -119,14 +161,15 @@ PollerFlux, TaskRunInner> beginCreateAsync(String resou /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, TaskRunInner> beginCreate(String resourceGroupName, String registryName, @@ -135,8 +178,8 @@ SyncPoller, TaskRunInner> beginCreate(String resourceGr /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. @@ -144,6 +187,7 @@ SyncPoller, TaskRunInner> beginCreate(String resourceGr * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, TaskRunInner> beginCreate(String resourceGroupName, String registryName, @@ -152,14 +196,15 @@ SyncPoller, TaskRunInner> beginCreate(String resourceGr /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono createAsync(String resourceGroupName, String registryName, String taskRunName, @@ -168,14 +213,15 @@ Mono createAsync(String resourceGroupName, String registryName, St /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.SINGLE) TaskRunInner create(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun); @@ -183,8 +229,8 @@ Mono createAsync(String resourceGroupName, String registryName, St /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. @@ -192,123 +238,24 @@ Mono createAsync(String resourceGroupName, String registryName, St * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.SINGLE) TaskRunInner create(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, Context context); - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all 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) - Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, - String taskRunName); - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, - String taskRunName); - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String taskRunName); - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String taskRunName, - Context context); - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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) - Mono deleteAsync(String resourceGroupName, String registryName, String taskRunName); - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String taskRunName); - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String taskRunName, Context context); - /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties along with {@link Response} on successful + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -318,14 +265,15 @@ Mono>> updateWithResponseAsync(String resourceGroupNam /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux, TaskRunInner> beginUpdateAsync(String resourceGroupName, String registryName, @@ -334,14 +282,15 @@ PollerFlux, TaskRunInner> beginUpdateAsync(String resou /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, TaskRunInner> beginUpdate(String resourceGroupName, String registryName, @@ -350,8 +299,8 @@ SyncPoller, TaskRunInner> beginUpdate(String resourceGr /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @param context The context to associate with this operation. @@ -359,6 +308,7 @@ SyncPoller, TaskRunInner> beginUpdate(String resourceGr * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, TaskRunInner> beginUpdate(String resourceGroupName, String registryName, @@ -367,14 +317,15 @@ SyncPoller, TaskRunInner> beginUpdate(String resourceGr /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono updateAsync(String resourceGroupName, String registryName, String taskRunName, @@ -383,14 +334,15 @@ Mono updateAsync(String resourceGroupName, String registryName, St /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.SINGLE) TaskRunInner update(String resourceGroupName, String registryName, String taskRunName, @@ -399,8 +351,8 @@ TaskRunInner update(String resourceGroupName, String registryName, String taskRu /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @param context The context to associate with this operation. @@ -408,109 +360,127 @@ TaskRunInner update(String resourceGroupName, String registryName, String taskRu * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.SINGLE) TaskRunInner update(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters, Context context); /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets along with {@link Response} on - * successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getDetailsWithResponseAsync(String resourceGroupName, String registryName, - String taskRunName); + Mono> deleteWithResponseAsync(String resourceGroupName, String registryName, String taskRunName); /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getDetailsAsync(String resourceGroupName, String registryName, String taskRunName); + Mono deleteAsync(String resourceGroupName, String registryName, String taskRunName); /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getDetailsWithResponse(String resourceGroupName, String registryName, String taskRunName, + Response deleteWithResponse(String resourceGroupName, String registryName, String taskRunName, Context context); /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets. */ @ServiceMethod(returns = ReturnType.SINGLE) - TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName); + void delete(String resourceGroupName, String registryName, String taskRunName); /** - * Lists all the task runs for a specified container registry. + * Gets the detailed information for a given task run that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs as paginated response with {@link PagedFlux}. + * @return the detailed information for a given task run that includes all secrets along with {@link Response} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String registryName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getDetailsWithResponseAsync(String resourceGroupName, String registryName, + String taskRunName); /** - * Lists all the task runs for a specified container registry. + * Gets the detailed information for a given task run that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs as paginated response with {@link PagedIterable}. + * @return the detailed information for a given task run that includes all secrets on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getDetailsAsync(String resourceGroupName, String registryName, String taskRunName); /** - * Lists all the task runs for a specified container registry. + * Gets the detailed information for a given task run that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs as paginated response with {@link PagedIterable}. + * @return the detailed information for a given task run that includes all secrets along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String registryName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getDetailsWithResponse(String resourceGroupName, String registryName, String taskRunName, + Context context); + + /** + * Gets the detailed information for a given task run that includes all secrets. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the detailed information for a given task run that includes all secrets. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java index 93e132854de2..f6d9421b774a 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java @@ -9,14 +9,9 @@ import com.azure.core.http.rest.PagedFlux; 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.PollerFlux; -import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; import com.azure.resourcemanager.containerregistry.models.TaskUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -26,8 +21,8 @@ public interface TasksClient { /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -39,8 +34,8 @@ public interface TasksClient { /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -52,8 +47,8 @@ public interface TasksClient { /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -66,8 +61,8 @@ public interface TasksClient { /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -80,8 +75,8 @@ public interface TasksClient { /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -94,8 +89,8 @@ public interface TasksClient { /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -110,8 +105,8 @@ Response getWithResponse(String resourceGroupName, String registryNam /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -124,80 +119,33 @@ Response getWithResponse(String resourceGroupName, String registryNam /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createWithResponseAsync(String resourceGroupName, String registryName, - String taskName, TaskInner taskCreateParameters); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, TaskInner> beginCreateAsync(String resourceGroupName, String registryName, - String taskName, TaskInner taskCreateParameters); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TaskInner> beginCreate(String resourceGroupName, String registryName, - String taskName, TaskInner taskCreateParameters); - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TaskInner> beginCreate(String resourceGroupName, String registryName, - String taskName, TaskInner taskCreateParameters, Context context); + Mono> createWithResponseAsync(String resourceGroupName, String registryName, String taskName, + TaskInner taskCreateParameters); /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono createAsync(String resourceGroupName, String registryName, String taskName, @@ -206,260 +154,174 @@ Mono createAsync(String resourceGroupName, String registryName, Strin /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner create(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); + Response createWithResponse(String resourceGroupName, String registryName, String taskName, + TaskInner taskCreateParameters, Context context); /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. */ @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner create(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters, - Context context); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all 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) - Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, - String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, String taskName, - Context context); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException 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) - Mono deleteAsync(String resourceGroupName, String registryName, String taskName); - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String taskName); + TaskInner create(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters); /** - * Deletes a specified task. + * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. + * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String registryName, String taskName, Context context); + Mono> updateWithResponseAsync(String resourceGroupName, String registryName, String taskName, + TaskUpdateParameters taskUpdateParameters); /** * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters); + Mono updateAsync(String resourceGroupName, String registryName, String taskName, + TaskUpdateParameters taskUpdateParameters); /** * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, TaskInner> beginUpdateAsync(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters); + @ServiceMethod(returns = ReturnType.SINGLE) + Response updateWithResponse(String resourceGroupName, String registryName, String taskName, + TaskUpdateParameters taskUpdateParameters, Context context); /** * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TaskInner> beginUpdate(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters); + @ServiceMethod(returns = ReturnType.SINGLE) + TaskInner update(String resourceGroupName, String registryName, String taskName, + TaskUpdateParameters taskUpdateParameters); /** - * Updates a task with the specified parameters. + * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. + * @return the {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, TaskInner> beginUpdate(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> deleteWithResponseAsync(String resourceGroupName, String registryName, String taskName); /** - * Updates a task with the specified parameters. + * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String registryName, String taskName, - TaskUpdateParameters taskUpdateParameters); + Mono deleteAsync(String resourceGroupName, String registryName, String taskName); /** - * Updates a task with the specified parameters. + * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner update(String resourceGroupName, String registryName, String taskName, - TaskUpdateParameters taskUpdateParameters); + Response deleteWithResponse(String resourceGroupName, String registryName, String taskName, Context context); /** - * Updates a task with the specified parameters. + * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - TaskInner update(String resourceGroupName, String registryName, String taskName, - TaskUpdateParameters taskUpdateParameters, Context context); + void delete(String resourceGroupName, String registryName, String taskName); /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -469,13 +331,14 @@ Mono> getDetailsWithResponseAsync(String resourceGroupName, /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) Mono getDetailsAsync(String resourceGroupName, String registryName, String taskName); @@ -483,14 +346,15 @@ Mono> getDetailsWithResponseAsync(String resourceGroupName, /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) Response getDetailsWithResponse(String resourceGroupName, String registryName, String taskName, @@ -499,13 +363,14 @@ Response getDetailsWithResponse(String resourceGroupName, String regi /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. */ @ServiceMethod(returns = ReturnType.SINGLE) TaskInner getDetails(String resourceGroupName, String registryName, String taskName); diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolInner.java index 49322ead9632..06feb5480dfb 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolInner.java @@ -27,7 +27,7 @@ public final class AgentPoolInner extends Resource { private AgentPoolProperties innerProperties; /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -62,7 +62,7 @@ private AgentPoolProperties innerProperties() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java index 1d7449348ee0..020362d81786 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java @@ -34,7 +34,7 @@ public final class RunInner extends ProxyResource { private RunProperties innerProperties; /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -69,7 +69,7 @@ private RunProperties innerProperties() { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java index 70311f245a8d..97be440a1e90 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java @@ -29,17 +29,17 @@ @Fluent public final class TaskInner extends Resource { /* - * Identity for the resource. + * The properties of a task. */ - private IdentityProperties identity; + private TaskProperties innerProperties; /* - * The properties of a task. + * Identity for the resource. */ - private TaskProperties innerProperties; + private IdentityProperties identity; /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -64,6 +64,15 @@ public final class TaskInner extends Resource { public TaskInner() { } + /** + * Get the innerProperties property: The properties of a task. + * + * @return the innerProperties value. + */ + private TaskProperties innerProperties() { + return this.innerProperties; + } + /** * Get the identity property: Identity for the resource. * @@ -85,16 +94,7 @@ public TaskInner withIdentity(IdentityProperties identity) { } /** - * Get the innerProperties property: The properties of a task. - * - * @return the innerProperties value. - */ - private TaskProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -410,12 +410,12 @@ public TaskInner withIsSystemTask(Boolean isSystemTask) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (identity() != null) { - identity().validate(); - } if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -426,8 +426,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -458,10 +458,10 @@ public static TaskInner fromJson(JsonReader jsonReader) throws IOException { } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedTaskInner.withTags(tags); - } else if ("identity".equals(fieldName)) { - deserializedTaskInner.identity = IdentityProperties.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedTaskInner.innerProperties = TaskProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedTaskInner.identity = IdentityProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedTaskInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunInner.java index 4d9203fa1fb9..81ce36b44394 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunInner.java @@ -22,14 +22,14 @@ @Fluent public final class TaskRunInner extends ProxyResource { /* - * Identity for the resource. + * The properties associated with the task run, i.e., request and result of the run */ - private IdentityProperties identity; + private TaskRunPropertiesInner innerProperties; /* - * The properties associated with the task run, i.e., request and result of the run + * Identity for the resource. */ - private TaskRunPropertiesInner innerProperties; + private IdentityProperties identity; /* * The location of the resource @@ -37,7 +37,7 @@ public final class TaskRunInner extends ProxyResource { private String location; /* - * Metadata pertaining to creation and last modification of the resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -62,6 +62,16 @@ public final class TaskRunInner extends ProxyResource { public TaskRunInner() { } + /** + * Get the innerProperties property: The properties associated with the task run, i.e., request and result of the + * run. + * + * @return the innerProperties value. + */ + private TaskRunPropertiesInner innerProperties() { + return this.innerProperties; + } + /** * Get the identity property: Identity for the resource. * @@ -82,16 +92,6 @@ public TaskRunInner withIdentity(IdentityProperties identity) { return this; } - /** - * Get the innerProperties property: The properties associated with the task run, i.e., request and result of the - * run. - * - * @return the innerProperties value. - */ - private TaskRunPropertiesInner innerProperties() { - return this.innerProperties; - } - /** * Get the location property: The location of the resource. * @@ -113,7 +113,7 @@ public TaskRunInner withLocation(String location) { } /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -223,12 +223,12 @@ public TaskRunInner withForceUpdateTag(String forceUpdateTag) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (identity() != null) { - identity().validate(); - } if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -237,8 +237,8 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -265,10 +265,10 @@ public static TaskRunInner fromJson(JsonReader jsonReader) throws IOException { deserializedTaskRunInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedTaskRunInner.type = reader.getString(); - } else if ("identity".equals(fieldName)) { - deserializedTaskRunInner.identity = IdentityProperties.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedTaskRunInner.innerProperties = TaskRunPropertiesInner.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedTaskRunInner.identity = IdentityProperties.fromJson(reader); } else if ("location".equals(fieldName)) { deserializedTaskRunInner.location = reader.getString(); } else if ("systemData".equals(fieldName)) { diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java index 4d3732d2d395..8d8f422c7ffa 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the inner data models for ContainerRegistryTasksManagementClient. - * null. + * The Microsoft Azure Container Registry management API provides create, read, update, and delete functionality for + * Azure Container Registry resources including registries, replications, webhooks, tasks, runs, and other registry + * components. */ package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java index 6a8c66a88093..b70378db2483 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the service clients for ContainerRegistryTasksManagementClient. - * null. + * The Microsoft Azure Container Registry management API provides create, read, update, and delete functionality for + * Azure Container Registry resources including registries, replications, webhooks, tasks, runs, and other registry + * components. */ package com.azure.resourcemanager.containerregistry.fluent; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java index c5b148cc9de8..864d6df88427 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java @@ -75,34 +75,31 @@ public final class AgentPoolsClientImpl implements AgentPoolsClient { @ServiceInterface(name = "ContainerRegistryTasksManagementClientAgentPools") public interface AgentPoolsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("agentPoolName") String agentPoolName, - @BodyParam("application/json") AgentPoolInner agentPool, @HeaderParam("Accept") String accept, - Context context); + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("agentPoolName") String agentPoolName, + @PathParam("agentPoolName") String agentPoolName, @BodyParam("application/json") AgentPoolInner agentPool, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -110,30 +107,29 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("agentPoolName") String agentPoolName, + @PathParam("agentPoolName") String agentPoolName, @BodyParam("application/json") AgentPoolUpdateParameters updateParameters, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getQueueStatus(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("agentPoolName") String agentPoolName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("agentPoolName") String agentPoolName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -143,11 +139,149 @@ Mono> listNext(@PathParam(value = "nextLink", enco @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of agent pools as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -178,16 +312,16 @@ public Mono> getWithResponseAsync(String resourceGroupN } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -219,15 +353,15 @@ private Mono> getWithResponseAsync(String resourceGroup } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - this.client.getApiVersion(), agentPoolName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, agentPoolName, accept, context); } /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -243,8 +377,8 @@ public Mono getAsync(String resourceGroupName, String registryNa /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -261,8 +395,8 @@ public Response getWithResponse(String resourceGroupName, String /** * Gets the detailed information for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -277,14 +411,15 @@ public AgentPoolInner get(String resourceGroupName, String registryName, String /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties along with {@link Response} on successful + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -315,24 +450,25 @@ public Mono>> createWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), agentPoolName, agentPool, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, agentPoolName, agentPool, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties along with {@link Response} on successful + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -363,21 +499,22 @@ private Mono>> createWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), agentPoolName, agentPool, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, agentPoolName, agentPool, accept, context); } /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, AgentPoolInner> beginCreateAsync(String resourceGroupName, @@ -391,8 +528,8 @@ public PollerFlux, AgentPoolInner> beginCreateAsync(S /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @param context The context to associate with this operation. @@ -400,6 +537,7 @@ public PollerFlux, AgentPoolInner> beginCreateAsync(S * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AgentPoolInner> beginCreateAsync(String resourceGroupName, @@ -414,14 +552,15 @@ private PollerFlux, AgentPoolInner> beginCreateAsync( /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AgentPoolInner> beginCreate(String resourceGroupName, @@ -432,8 +571,8 @@ public SyncPoller, AgentPoolInner> beginCreate(String /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @param context The context to associate with this operation. @@ -441,6 +580,7 @@ public SyncPoller, AgentPoolInner> beginCreate(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AgentPoolInner> beginCreate(String resourceGroupName, @@ -452,14 +592,15 @@ public SyncPoller, AgentPoolInner> beginCreate(String /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createAsync(String resourceGroupName, String registryName, String agentPoolName, @@ -471,15 +612,16 @@ public Mono createAsync(String resourceGroupName, String registr /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String registryName, String agentPoolName, @@ -491,14 +633,15 @@ private Mono createAsync(String resourceGroupName, String regist /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.SINGLE) public AgentPoolInner create(String resourceGroupName, String registryName, String agentPoolName, @@ -509,8 +652,8 @@ public AgentPoolInner create(String resourceGroupName, String registryName, Stri /** * Creates an agent pool for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param agentPool The parameters of an agent pool that needs to scheduled. * @param context The context to associate with this operation. @@ -518,6 +661,7 @@ public AgentPoolInner create(String resourceGroupName, String registryName, Stri * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.SINGLE) public AgentPoolInner create(String resourceGroupName, String registryName, String agentPoolName, @@ -525,238 +669,18 @@ public AgentPoolInner create(String resourceGroupName, String registryName, Stri return createAsync(resourceGroupName, registryName, agentPoolName, agentPool, context).block(); } - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all 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) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, - String agentPoolName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all 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 registryName, - String agentPoolName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (agentPoolName == null) { - return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), agentPoolName, accept, context); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, - String agentPoolName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, agentPoolName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, - String agentPoolName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, registryName, agentPoolName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, - String agentPoolName) { - return this.beginDeleteAsync(resourceGroupName, registryName, agentPoolName).getSyncPoller(); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, - String agentPoolName, Context context) { - return this.beginDeleteAsync(resourceGroupName, registryName, agentPoolName, context).getSyncPoller(); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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) - public Mono deleteAsync(String resourceGroupName, String registryName, String agentPoolName) { - return beginDeleteAsync(resourceGroupName, registryName, agentPoolName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 registryName, String agentPoolName, - Context context) { - return beginDeleteAsync(resourceGroupName, registryName, agentPoolName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String agentPoolName) { - deleteAsync(resourceGroupName, registryName, agentPoolName).block(); - } - - /** - * Deletes a specified agent pool resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param agentPoolName The name of the agent pool. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String agentPoolName, Context context) { - deleteAsync(resourceGroupName, registryName, agentPoolName, context).block(); - } - /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties along with {@link Response} on successful + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -788,24 +712,25 @@ public Mono>> updateWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), agentPoolName, updateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, agentPoolName, updateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties along with {@link Response} on successful + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -837,21 +762,22 @@ private Mono>> updateWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), agentPoolName, updateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, agentPoolName, updateParameters, accept, context); } /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, AgentPoolInner> beginUpdateAsync(String resourceGroupName, @@ -865,8 +791,8 @@ public PollerFlux, AgentPoolInner> beginUpdateAsync(S /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. @@ -874,6 +800,7 @@ public PollerFlux, AgentPoolInner> beginUpdateAsync(S * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, AgentPoolInner> beginUpdateAsync(String resourceGroupName, @@ -888,14 +815,15 @@ private PollerFlux, AgentPoolInner> beginUpdateAsync( /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AgentPoolInner> beginUpdate(String resourceGroupName, @@ -906,8 +834,8 @@ public SyncPoller, AgentPoolInner> beginUpdate(String /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. @@ -915,6 +843,7 @@ public SyncPoller, AgentPoolInner> beginUpdate(String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, AgentPoolInner> beginUpdate(String resourceGroupName, @@ -926,14 +855,15 @@ public SyncPoller, AgentPoolInner> beginUpdate(String /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync(String resourceGroupName, String registryName, String agentPoolName, @@ -945,15 +875,16 @@ public Mono updateAsync(String resourceGroupName, String registr /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the agentpool that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String registryName, String agentPoolName, @@ -965,14 +896,15 @@ private Mono updateAsync(String resourceGroupName, String regist /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.SINGLE) public AgentPoolInner update(String resourceGroupName, String registryName, String agentPoolName, @@ -983,8 +915,8 @@ public AgentPoolInner update(String resourceGroupName, String registryName, Stri /** * Updates an agent pool with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param updateParameters The parameters for updating an agent pool. * @param context The context to associate with this operation. @@ -992,6 +924,7 @@ public AgentPoolInner update(String resourceGroupName, String registryName, Stri * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. */ @ServiceMethod(returns = ReturnType.SINGLE) public AgentPoolInner update(String resourceGroupName, String registryName, String agentPoolName, @@ -1000,17 +933,19 @@ public AgentPoolInner update(String resourceGroupName, String registryName, Stri } /** - * Lists all the agent pools for a specified container registry. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String agentPoolName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1026,29 +961,31 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the agent pools for a specified container registry. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String registryName, - Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, + String agentPoolName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1064,84 +1001,163 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } + if (agentPoolName == null) { + return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, agentPoolName, accept, context); } /** - * Lists all the agent pools for a specified container registry. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String registryName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String agentPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, agentPoolName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Lists all the agent pools for a specified container registry. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, + String agentPoolName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, registryName, agentPoolName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Lists all the agent pools for a specified container registry. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String agentPoolName) { + return this.beginDeleteAsync(resourceGroupName, registryName, agentPoolName).getSyncPoller(); } /** - * Lists all the agent pools for a specified container registry. + * Deletes a specified agent pool resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of agent pools as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, + String agentPoolName, Context context) { + return this.beginDeleteAsync(resourceGroupName, registryName, agentPoolName, context).getSyncPoller(); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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) + public Mono deleteAsync(String resourceGroupName, String registryName, String agentPoolName) { + return beginDeleteAsync(resourceGroupName, registryName, agentPoolName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException 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 registryName, String agentPoolName, + Context context) { + return beginDeleteAsync(resourceGroupName, registryName, agentPoolName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String agentPoolName) { + deleteAsync(resourceGroupName, registryName, agentPoolName).block(); + } + + /** + * Deletes a specified agent pool resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param agentPoolName The name of the agent pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void delete(String resourceGroupName, String registryName, String agentPoolName, Context context) { + deleteAsync(resourceGroupName, registryName, agentPoolName, context).block(); } /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1172,16 +1188,16 @@ public Mono> getQueueStatusWithResponseAsync } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getQueueStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) + .withContext(context -> service.getQueueStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1213,15 +1229,15 @@ private Mono> getQueueStatusWithResponseAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getQueueStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), agentPoolName, accept, context); + return service.getQueueStatus(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, agentPoolName, accept, context); } /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1238,8 +1254,8 @@ public Mono getQueueStatusAsync(String resourceGroupN /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1256,8 +1272,8 @@ public Response getQueueStatusWithResponse(String res /** * Gets the count of queued runs for a given agent pool. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param agentPoolName The name of the agent pool. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java index aae9fb50a8d0..a3e117cf0007 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { ContainerRegistryTasksManagementClientImpl.class }) public final class ContainerRegistryTasksManagementClientBuilder { /* - * The Microsoft Azure subscription ID. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets The Microsoft Azure subscription ID. + * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. * @return the ContainerRegistryTasksManagementClientBuilder. diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java index 8f5232a26682..9fafc2bf60a0 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java @@ -24,12 +24,12 @@ public final class ContainerRegistryTasksManagementClientImpl extends AzureServiceClient implements ContainerRegistryTasksManagementClient { /** - * The Microsoft Azure subscription ID. + * The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets The Microsoft Azure subscription ID. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -184,7 +184,7 @@ public TasksClient getTasks() { * @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 Microsoft Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ ContainerRegistryTasksManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -195,7 +195,7 @@ public TasksClient getTasks() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2019-06-01-preview"; + this.apiVersion = "2025-03-01-preview"; this.agentPools = new AgentPoolsClientImpl(this); this.registryTasks = new RegistryTasksClientImpl(this); this.runs = new RunsClientImpl(this); diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java index 46f1d4a0b149..650d31f00c49 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java @@ -20,17 +20,12 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.containerregistry.fluent.RegistryTasksClient; import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; import com.azure.resourcemanager.containerregistry.models.RunRequest; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -66,39 +61,39 @@ public final class RegistryTasksClientImpl implements RegistryTasksClient { @ServiceInterface(name = "ContainerRegistryTasksManagementClientRegistryTasks") public interface RegistryTasksService { @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") - @ExpectedResponses({ 200, 202 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> scheduleRun(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getBuildSourceUploadUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") RunRequest runRequest, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuildSourceUploadUrl(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> scheduleRun(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @BodyParam("application/json") RunRequest runRequest, @HeaderParam("Accept") String accept, + Context context); } /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. + * @return the upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest) { + public Mono> + getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -114,33 +109,29 @@ public Mono>> scheduleRunWithResponseAsync(String reso if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - if (runRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); - } else { - runRequest.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), runRequest, accept, context)) + .withContext( + context -> service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. + * @return the upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest, Context context) { + private Mono> + getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -156,177 +147,76 @@ private Mono>> scheduleRunWithResponseAsync(String res if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - if (runRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); - } else { - runRequest.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), runRequest, accept, context); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, - String registryName, RunRequest runRequest) { - Mono>> mono - = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, - RunInner.class, this.client.getContext()); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, - String registryName, RunRequest runRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, - RunInner.class, context); + return service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context); } /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest) { - return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest).getSyncPoller(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest, Context context) { - return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).getSyncPoller(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. + * @return the upload location for the user to be able to upload the source on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono getBuildSourceUploadUrlAsync(String resourceGroupName, + String registryName) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. + * @return the upload location for the user to be able to upload the source along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, - Context context) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, + String registryName, Context context) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, context).block(); } /** - * Schedules a new run based on the request parameters and add it to the run queue. + * Get the upload location for the user to be able to upload the source. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. + * @return the upload location for the user to be able to upload the source. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { - return scheduleRunAsync(resourceGroupName, registryName, runRequest).block(); + public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); } /** * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context) { - return scheduleRunAsync(resourceGroupName, registryName, runRequest, context).block(); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. + * @param runRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. + * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName) { + public Mono> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -342,29 +232,33 @@ public RunInner scheduleRun(String resourceGroupName, String registryName, RunRe if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } + if (runRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); + } else { + runRequest.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.scheduleRun(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, runRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the upload location for the user to be able to upload the source. + * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. + * @param runRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. + * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName, Context context) { + private Mono> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -380,59 +274,65 @@ public RunInner scheduleRun(String resourceGroupName, String registryName, RunRe if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } + if (runRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); + } else { + runRequest.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), accept, context); + return service.scheduleRun(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, runRequest, accept, context); } /** - * Get the upload location for the user to be able to upload the source. + * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. + * @param runRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source on successful completion of - * {@link Mono}. + * @return run resource properties on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBuildSourceUploadUrlAsync(String resourceGroupName, - String registryName) { - return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) + public Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get the upload location for the user to be able to upload the source. + * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. + * @param runRequest The request body. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source along with {@link Response}. + * @return run resource properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, - String registryName, Context context) { - return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, context).block(); + public Response scheduleRunWithResponse(String resourceGroupName, String registryName, + RunRequest runRequest, Context context) { + return scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest, context).block(); } /** - * Get the upload location for the user to be able to upload the source. + * Schedules a new run based on the request parameters and add it to the run queue. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param registryName The name of the container registry. + * @param runRequest The request body. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the upload location for the user to be able to upload the source. + * @return run resource properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { - return getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunWithResponse(resourceGroupName, registryName, runRequest, Context.NONE).getValue(); } } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java index fc87f769665d..a2ba35c11e9c 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java @@ -26,18 +26,13 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.containerregistry.fluent.RunsClient; import com.azure.resourcemanager.containerregistry.fluent.models.RunGetLogResultInner; import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; import com.azure.resourcemanager.containerregistry.models.RunListResult; import com.azure.resourcemanager.containerregistry.models.RunUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -76,51 +71,47 @@ public interface RunsService { @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context); + @QueryParam("$filter") String filter, @QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("runId") String runId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("runId") String runId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}") - @ExpectedResponses({ 200, 201 }) + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("runId") String runId, - @BodyParam("application/json") RunUpdateParameters runUpdateParameters, + @PathParam("runId") String runId, @BodyParam("application/json") RunUpdateParameters runUpdateParameters, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getLogSasUrl(@HostParam("$host") String endpoint, + Mono> cancel(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("runId") String runId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("runId") String runId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel") - @ExpectedResponses({ 200, 202 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> cancel(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getLogSasUrl(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("runId") String runId, - @HeaderParam("Accept") String accept, Context context); + @PathParam("runId") String runId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -133,8 +124,8 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. @@ -163,8 +154,8 @@ private Mono> listSinglePageAsync(String resourceGroupNa } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), filter, top, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, filter, top, 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())); @@ -173,8 +164,8 @@ private Mono> listSinglePageAsync(String resourceGroupNa /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. @@ -205,8 +196,8 @@ private Mono> listSinglePageAsync(String resourceGroupNa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - this.client.getApiVersion(), filter, top, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, filter, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -214,8 +205,8 @@ private Mono> listSinglePageAsync(String resourceGroupNa /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. @@ -233,8 +224,8 @@ public PagedFlux listAsync(String resourceGroupName, String registryNa /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -251,8 +242,8 @@ public PagedFlux listAsync(String resourceGroupName, String registryNa /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. @@ -272,8 +263,8 @@ private PagedFlux listAsync(String resourceGroupName, String registryN /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -289,8 +280,8 @@ public PagedIterable list(String resourceGroupName, String registryNam /** * Gets all the runs for a registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param filter The runs filter to apply on the operation. Arithmetic operators are not supported. The allowed * string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. * @param top $top is supported for get list of runs, which limits the maximum number of runs to return. @@ -309,8 +300,8 @@ public PagedIterable list(String resourceGroupName, String registryNam /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -340,16 +331,16 @@ public Mono> getWithResponseAsync(String resourceGroupName, S } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -381,15 +372,15 @@ private Mono> getWithResponseAsync(String resourceGroupName, } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - this.client.getApiVersion(), runId, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, runId, accept, context); } /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -405,8 +396,8 @@ public Mono getAsync(String resourceGroupName, String registryName, St /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -423,8 +414,8 @@ public Response getWithResponse(String resourceGroupName, String regis /** * Gets the detailed information for a given run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -439,8 +430,8 @@ public RunInner get(String resourceGroupName, String registryName, String runId) /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -449,8 +440,8 @@ public RunInner get(String resourceGroupName, String registryName, String runId) * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync(String resourceGroupName, String registryName, - String runId, RunUpdateParameters runUpdateParameters) { + public Mono> updateWithResponseAsync(String resourceGroupName, String registryName, String runId, + RunUpdateParameters runUpdateParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -477,17 +468,17 @@ public Mono>> updateWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), runId, runUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, runId, runUpdateParameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. * @param context The context to associate with this operation. @@ -497,7 +488,7 @@ public Mono>> updateWithResponseAsync(String resourceG * @return run resource properties along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String registryName, + private Mono> updateWithResponseAsync(String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -525,97 +516,15 @@ private Mono>> updateWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), runId, runUpdateParameters, accept, context); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, RunInner> beginUpdateAsync(String resourceGroupName, String registryName, - String runId, RunUpdateParameters runUpdateParameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, registryName, runId, runUpdateParameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, - RunInner.class, this.client.getContext()); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RunInner> beginUpdateAsync(String resourceGroupName, String registryName, - String runId, RunUpdateParameters runUpdateParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, registryName, runId, runUpdateParameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, - RunInner.class, context); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginUpdate(String resourceGroupName, String registryName, - String runId, RunUpdateParameters runUpdateParameters) { - return this.beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters).getSyncPoller(); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginUpdate(String resourceGroupName, String registryName, - String runId, RunUpdateParameters runUpdateParameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context) - .getSyncPoller(); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, runId, runUpdateParameters, accept, context); } /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -626,35 +535,34 @@ public SyncPoller, RunInner> beginUpdate(String resourceGro @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync(String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters).last() - .flatMap(this.client::getLroFinalResultOrError); + return updateWithResponseAsync(resourceGroupName, registryName, runId, runUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties on successful completion of {@link Mono}. + * @return run resource properties along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String registryName, String runId, + public Response updateWithResponse(String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters, Context context) { - return beginUpdateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + return updateWithResponseAsync(resourceGroupName, registryName, runId, runUpdateParameters, context).block(); } /** * Patch the run properties. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param runUpdateParameters The run update properties. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -665,42 +573,22 @@ private Mono updateAsync(String resourceGroupName, String registryName @ServiceMethod(returns = ReturnType.SINGLE) public RunInner update(String resourceGroupName, String registryName, String runId, RunUpdateParameters runUpdateParameters) { - return updateAsync(resourceGroupName, registryName, runId, runUpdateParameters).block(); - } - - /** - * Patch the run properties. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param runUpdateParameters The run update properties. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner update(String resourceGroupName, String registryName, String runId, - RunUpdateParameters runUpdateParameters, Context context) { - return updateAsync(resourceGroupName, registryName, runId, runUpdateParameters, context).block(); + return updateWithResponse(resourceGroupName, registryName, runId, runUpdateParameters, Context.NONE).getValue(); } /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 to download the run logs along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getLogSasUrlWithResponseAsync(String resourceGroupName, - String registryName, String runId) { + public Mono> cancelWithResponseAsync(String resourceGroupName, String registryName, String runId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -721,26 +609,26 @@ public Mono> getLogSasUrlWithResponseAsync(String } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getLogSasUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 to download the run logs along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getLogSasUrlWithResponseAsync(String resourceGroupName, - String registryName, String runId, Context context) { + private Mono> cancelWithResponseAsync(String resourceGroupName, String registryName, String runId, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -761,75 +649,73 @@ private Mono> getLogSasUrlWithResponseAsync(Strin } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getLogSasUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), runId, accept, context); + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, runId, accept, context); } /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 to download the run logs on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { - return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono cancelAsync(String resourceGroupName, String registryName, String runId) { + return cancelWithResponseAsync(resourceGroupName, registryName, runId).flatMap(ignored -> Mono.empty()); } /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 to download the run logs along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getLogSasUrlWithResponse(String resourceGroupName, String registryName, - String runId, Context context) { - return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId, context).block(); + public Response cancelWithResponse(String resourceGroupName, String registryName, String runId, + Context context) { + return cancelWithResponseAsync(resourceGroupName, registryName, runId, context).block(); } /** - * Gets a link to download the run logs. + * Cancel an existing run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 to download the run logs. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) { - return getLogSasUrlWithResponse(resourceGroupName, registryName, runId, Context.NONE).getValue(); + public void cancel(String resourceGroupName, String registryName, String runId) { + cancelWithResponse(resourceGroupName, registryName, runId, Context.NONE); } /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a link to download the run logs along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> cancelWithResponseAsync(String resourceGroupName, String registryName, - String runId) { + public Mono> getLogSasUrlWithResponseAsync(String resourceGroupName, + String registryName, String runId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -850,26 +736,26 @@ public Mono>> cancelWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) + .withContext(context -> service.getLogSasUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return a link to download the run logs along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cancelWithResponseAsync(String resourceGroupName, String registryName, - String runId, Context context) { + private Mono> getLogSasUrlWithResponseAsync(String resourceGroupName, + String registryName, String runId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -890,149 +776,59 @@ private Mono>> cancelWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), runId, accept, context); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginCancelAsync(String resourceGroupName, String registryName, - String runId) { - Mono>> mono = cancelWithResponseAsync(resourceGroupName, registryName, runId); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String registryName, - String runId, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = cancelWithResponseAsync(resourceGroupName, registryName, runId, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return service.getLogSasUrl(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, runId, accept, context); } /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId) { - return this.beginCancelAsync(resourceGroupName, registryName, runId).getSyncPoller(); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCancel(String resourceGroupName, String registryName, String runId, - Context context) { - return this.beginCancelAsync(resourceGroupName, registryName, runId, context).getSyncPoller(); - } - - /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return a link to download the run logs on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono cancelAsync(String resourceGroupName, String registryName, String runId) { - return beginCancelAsync(resourceGroupName, registryName, runId).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 cancelAsync(String resourceGroupName, String registryName, String runId, Context context) { - return beginCancelAsync(resourceGroupName, registryName, runId, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Cancel an existing run. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runId The run ID. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 to download the run logs along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String registryName, String runId) { - cancelAsync(resourceGroupName, registryName, runId).block(); + public Response getLogSasUrlWithResponse(String resourceGroupName, String registryName, + String runId, Context context) { + return getLogSasUrlWithResponseAsync(resourceGroupName, registryName, runId, context).block(); } /** - * Cancel an existing run. + * Gets a link to download the run logs. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param runId The run ID. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException 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 to download the run logs. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String registryName, String runId, Context context) { - cancelAsync(resourceGroupName, registryName, runId, context).block(); + public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithResponse(resourceGroupName, registryName, runId, Context.NONE).getValue(); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java index bcdbf2250c24..94ad5c9ed669 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java @@ -73,33 +73,31 @@ public final class TaskRunsClientImpl implements TaskRunsClient { @ServiceInterface(name = "ContainerRegistryTasksManagementClientTaskRuns") public interface TaskRunsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskRunName") String taskRunName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskRunName") String taskRunName, - @BodyParam("application/json") TaskRunInner taskRun, @HeaderParam("Accept") String accept, Context context); + @PathParam("taskRunName") String taskRunName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") - @ExpectedResponses({ 200, 202, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskRunName") String taskRunName, + @PathParam("taskRunName") String taskRunName, @BodyParam("application/json") TaskRunInner taskRun, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -107,30 +105,29 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskRunName") String taskRunName, + @PathParam("taskRunName") String taskRunName, @BodyParam("application/json") TaskRunUpdateParameters updateParameters, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}/listDetails") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getDetails(@HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskRunName") String taskRunName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("taskRunName") String taskRunName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}/listDetails") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getDetails(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("taskRunName") String taskRunName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -140,11 +137,149 @@ Mono> listNext(@PathParam(value = "nextLink", encode @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String registryName, + Context context) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String registryName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the collection of task runs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String registryName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + } + /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -175,16 +310,16 @@ public Mono> getWithResponseAsync(String resourceGroupNam } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -216,15 +351,15 @@ private Mono> getWithResponseAsync(String resourceGroupNa } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - this.client.getApiVersion(), taskRunName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, taskRunName, accept, context); } /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -240,8 +375,8 @@ public Mono getAsync(String resourceGroupName, String registryName /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -258,8 +393,8 @@ public Response getWithResponse(String resourceGroupName, String r /** * Gets the detailed information for a given task run. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -274,14 +409,15 @@ public TaskRunInner get(String resourceGroupName, String registryName, String ta /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties along with {@link Response} on successful + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -311,24 +447,24 @@ public Mono>> createWithResponseAsync(String resourceG taskRun.validate(); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, taskRun, accept, context)) + return FluxUtil.withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskRunName, taskRun, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties along with {@link Response} on successful + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -359,21 +495,22 @@ private Mono>> createWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskRunName, taskRun, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, taskRunName, taskRun, accept, context); } /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, TaskRunInner> beginCreateAsync(String resourceGroupName, @@ -387,8 +524,8 @@ public PollerFlux, TaskRunInner> beginCreateAsync(Strin /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. @@ -396,6 +533,7 @@ public PollerFlux, TaskRunInner> beginCreateAsync(Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TaskRunInner> beginCreateAsync(String resourceGroupName, @@ -410,14 +548,15 @@ private PollerFlux, TaskRunInner> beginCreateAsync(Stri /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TaskRunInner> beginCreate(String resourceGroupName, String registryName, @@ -428,8 +567,8 @@ public SyncPoller, TaskRunInner> beginCreate(String res /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. @@ -437,6 +576,7 @@ public SyncPoller, TaskRunInner> beginCreate(String res * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TaskRunInner> beginCreate(String resourceGroupName, String registryName, @@ -447,14 +587,15 @@ public SyncPoller, TaskRunInner> beginCreate(String res /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createAsync(String resourceGroupName, String registryName, String taskRunName, @@ -466,15 +607,16 @@ public Mono createAsync(String resourceGroupName, String registryN /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createAsync(String resourceGroupName, String registryName, String taskRunName, @@ -486,14 +628,15 @@ private Mono createAsync(String resourceGroupName, String registry /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.SINGLE) public TaskRunInner create(String resourceGroupName, String registryName, String taskRunName, @@ -504,8 +647,8 @@ public TaskRunInner create(String resourceGroupName, String registryName, String /** * Creates a task run for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param taskRun The parameters of a run that needs to scheduled. * @param context The context to associate with this operation. @@ -513,6 +656,7 @@ public TaskRunInner create(String resourceGroupName, String registryName, String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.SINGLE) public TaskRunInner create(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, @@ -520,237 +664,18 @@ public TaskRunInner create(String resourceGroupName, String registryName, String return createAsync(resourceGroupName, registryName, taskRunName, taskRun, context).block(); } - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all 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) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, - String taskRunName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskRunName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all 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 registryName, - String taskRunName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (taskRunName == null) { - return Mono.error(new IllegalArgumentException("Parameter taskRunName 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, - registryName, this.client.getApiVersion(), taskRunName, accept, context); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, - String taskRunName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, taskRunName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, - String taskRunName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, registryName, taskRunName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, - String taskRunName) { - return this.beginDeleteAsync(resourceGroupName, registryName, taskRunName).getSyncPoller(); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, - String taskRunName, Context context) { - return this.beginDeleteAsync(resourceGroupName, registryName, taskRunName, context).getSyncPoller(); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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) - public Mono deleteAsync(String resourceGroupName, String registryName, String taskRunName) { - return beginDeleteAsync(resourceGroupName, registryName, taskRunName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException 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 registryName, String taskRunName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, taskRunName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String taskRunName) { - deleteAsync(resourceGroupName, registryName, taskRunName).block(); - } - - /** - * Deletes a specified task run resource. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskRunName The name of the task run. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String taskRunName, Context context) { - deleteAsync(resourceGroupName, registryName, taskRunName, context).block(); - } - /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties along with {@link Response} on successful + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -782,24 +707,25 @@ public Mono>> updateWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskRunName, updateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskRunName, updateParameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties along with {@link Response} on successful + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -831,21 +757,22 @@ private Mono>> updateWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskRunName, updateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, taskRunName, updateParameters, accept, context); } /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, TaskRunInner> beginUpdateAsync(String resourceGroupName, @@ -859,8 +786,8 @@ public PollerFlux, TaskRunInner> beginUpdateAsync(Strin /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @param context The context to associate with this operation. @@ -868,6 +795,7 @@ public PollerFlux, TaskRunInner> beginUpdateAsync(Strin * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TaskRunInner> beginUpdateAsync(String resourceGroupName, @@ -882,14 +810,15 @@ private PollerFlux, TaskRunInner> beginUpdateAsync(Stri /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TaskRunInner> beginUpdate(String resourceGroupName, String registryName, @@ -900,8 +829,8 @@ public SyncPoller, TaskRunInner> beginUpdate(String res /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @param context The context to associate with this operation. @@ -909,6 +838,7 @@ public SyncPoller, TaskRunInner> beginUpdate(String res * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link SyncPoller} for polling of the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TaskRunInner> beginUpdate(String resourceGroupName, String registryName, @@ -920,14 +850,15 @@ public SyncPoller, TaskRunInner> beginUpdate(String res /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono updateAsync(String resourceGroupName, String registryName, String taskRunName, @@ -939,15 +870,16 @@ public Mono updateAsync(String resourceGroupName, String registryN /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task run that has the ARM resource and properties on successful completion of {@link Mono}. + * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String registryName, String taskRunName, @@ -959,14 +891,15 @@ private Mono updateAsync(String resourceGroupName, String registry /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.SINGLE) public TaskRunInner update(String resourceGroupName, String registryName, String taskRunName, @@ -977,8 +910,8 @@ public TaskRunInner update(String resourceGroupName, String registryName, String /** * Updates a task run with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param updateParameters The parameters for updating a task run. * @param context The context to associate with this operation. @@ -986,6 +919,7 @@ public TaskRunInner update(String resourceGroupName, String registryName, String * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. */ @ServiceMethod(returns = ReturnType.SINGLE) public TaskRunInner update(String resourceGroupName, String registryName, String taskRunName, @@ -994,19 +928,18 @@ public TaskRunInner update(String resourceGroupName, String registryName, String } /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets along with {@link Response} on - * successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getDetailsWithResponseAsync(String resourceGroupName, String registryName, + public Mono> deleteWithResponseAsync(String resourceGroupName, String registryName, String taskRunName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1028,26 +961,25 @@ public Mono> getDetailsWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets along with {@link Response} on - * successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getDetailsWithResponseAsync(String resourceGroupName, String registryName, + private Mono> deleteWithResponseAsync(String resourceGroupName, String registryName, String taskRunName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1069,74 +1001,74 @@ private Mono> getDetailsWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskRunName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, taskRunName, accept, context); } /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getDetailsAsync(String resourceGroupName, String registryName, String taskRunName) { - return getDetailsWithResponseAsync(resourceGroupName, registryName, taskRunName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String registryName, String taskRunName) { + return deleteWithResponseAsync(resourceGroupName, registryName, taskRunName).flatMap(ignored -> Mono.empty()); } /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getDetailsWithResponse(String resourceGroupName, String registryName, - String taskRunName, Context context) { - return getDetailsWithResponseAsync(resourceGroupName, registryName, taskRunName, context).block(); + public Response deleteWithResponse(String resourceGroupName, String registryName, String taskRunName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, registryName, taskRunName, context).block(); } /** - * Gets the detailed information for a given task run that includes all secrets. + * Deletes a specified task run resource. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the detailed information for a given task run that includes all secrets. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName) { - return getDetailsWithResponse(resourceGroupName, registryName, taskRunName, Context.NONE).getValue(); + public void delete(String resourceGroupName, String registryName, String taskRunName) { + deleteWithResponse(resourceGroupName, registryName, taskRunName, Context.NONE); } /** - * Lists all the task runs for a specified container registry. + * Gets the detailed information for a given task run that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the detailed information for a given task run that includes all secrets along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String registryName) { + public Mono> getDetailsWithResponseAsync(String resourceGroupName, String registryName, + String taskRunName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1152,29 +1084,32 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the task runs for a specified container registry. + * Gets the detailed information for a given task run that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the detailed information for a given task run that includes all secrets along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String registryName, - Context context) { + private Mono> getDetailsWithResponseAsync(String resourceGroupName, String registryName, + String taskRunName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1190,77 +1125,65 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } + if (taskRunName == null) { + return Mono.error(new IllegalArgumentException("Parameter taskRunName 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, registryName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.getDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskRunName, accept, context); } /** - * Lists all the task runs for a specified container registry. + * Gets the detailed information for a given task run that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs as paginated response with {@link PagedFlux}. + * @return the detailed information for a given task run that includes all secrets on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String registryName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getDetailsAsync(String resourceGroupName, String registryName, String taskRunName) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskRunName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists all the task runs for a specified container registry. + * Gets the detailed information for a given task run that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String registryName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, registryName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the task runs for a specified container registry. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs as paginated response with {@link PagedIterable}. + * @return the detailed information for a given task run that includes all secrets along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getDetailsWithResponse(String resourceGroupName, String registryName, + String taskRunName, Context context) { + return getDetailsWithResponseAsync(resourceGroupName, registryName, taskRunName, context).block(); } /** - * Lists all the task runs for a specified container registry. + * Gets the detailed information for a given task run that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. + * @param taskRunName The name of the task run. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the collection of task runs as paginated response with {@link PagedIterable}. + * @return the detailed information for a given task run that includes all secrets. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String registryName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, registryName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName) { + return getDetailsWithResponse(resourceGroupName, registryName, taskRunName, Context.NONE).getValue(); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java index 01e816dd67c2..d3f63f39a08b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java @@ -28,17 +28,12 @@ import com.azure.core.http.rest.Response; import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.containerregistry.fluent.TasksClient; import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; import com.azure.resourcemanager.containerregistry.models.TaskListResult; import com.azure.resourcemanager.containerregistry.models.TaskUpdateParameters; -import java.nio.ByteBuffer; -import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -77,61 +72,57 @@ public interface TasksService { @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskName") String taskName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("taskName") String taskName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskName") String taskName, - @BodyParam("application/json") TaskInner taskCreateParameters, @HeaderParam("Accept") String accept, - Context context); + @PathParam("taskName") String taskName, @BodyParam("application/json") TaskInner taskCreateParameters, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") - @ExpectedResponses({ 200, 202, 204 }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskName") String taskName, + @PathParam("taskName") String taskName, + @BodyParam("application/json") TaskUpdateParameters taskUpdateParameters, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") - @ExpectedResponses({ 200, 201 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskName") String taskName, - @BodyParam("application/json") TaskUpdateParameters taskUpdateParameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("taskName") String taskName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> getDetails(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @PathParam("taskName") String taskName, - @HeaderParam("Accept") String accept, Context context); + @PathParam("taskName") String taskName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -144,8 +135,8 @@ Mono> listNext(@PathParam(value = "nextLink", encoded = /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -170,8 +161,8 @@ private Mono> listSinglePageAsync(String resourceGroupN } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -180,8 +171,8 @@ private Mono> listSinglePageAsync(String resourceGroupN /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -209,8 +200,8 @@ private Mono> listSinglePageAsync(String resourceGroupN final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - this.client.getApiVersion(), accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -218,8 +209,8 @@ private Mono> listSinglePageAsync(String resourceGroupN /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -234,8 +225,8 @@ public PagedFlux listAsync(String resourceGroupName, String registryN /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -251,8 +242,8 @@ private PagedFlux listAsync(String resourceGroupName, String registry /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -266,8 +257,8 @@ public PagedIterable list(String resourceGroupName, String registryNa /** * Lists all the tasks for a specified container registry. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -282,8 +273,8 @@ public PagedIterable list(String resourceGroupName, String registryNa /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -313,16 +304,16 @@ public Mono> getWithResponseAsync(String resourceGroupName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -353,15 +344,15 @@ private Mono> getWithResponseAsync(String resourceGroupName, } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - this.client.getApiVersion(), taskName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, taskName, accept, context); } /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -377,8 +368,8 @@ public Mono getAsync(String resourceGroupName, String registryName, S /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -395,8 +386,8 @@ public Response getWithResponse(String resourceGroupName, String regi /** * Get the properties of a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -411,18 +402,19 @@ public TaskInner get(String resourceGroupName, String registryName, String taskN /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createWithResponseAsync(String resourceGroupName, String registryName, + public Mono> createWithResponseAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -450,28 +442,29 @@ public Mono>> createWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskName, taskCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskName, taskCreateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String registryName, + private Mono> createWithResponseAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -499,182 +492,88 @@ private Mono>> createWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskName, taskCreateParameters, accept, context); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, TaskInner> beginCreateAsync(String resourceGroupName, String registryName, - String taskName, TaskInner taskCreateParameters) { - Mono>> mono - = createWithResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), TaskInner.class, - TaskInner.class, this.client.getContext()); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TaskInner> beginCreateAsync(String resourceGroupName, String registryName, - String taskName, TaskInner taskCreateParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), TaskInner.class, - TaskInner.class, context); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TaskInner> beginCreate(String resourceGroupName, String registryName, - String taskName, TaskInner taskCreateParameters) { - return this.beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters).getSyncPoller(); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, taskName, taskCreateParameters, accept, context); } /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TaskInner> beginCreate(String resourceGroupName, String registryName, - String taskName, TaskInner taskCreateParameters, Context context) { - return this.beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context) - .getSyncPoller(); - } - - /** - * Creates a task for a container registry with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono createAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { - return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters).last() - .flatMap(this.client::getLroFinalResultOrError); + return createWithResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String registryName, String taskName, + public Response createWithResponse(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters, Context context) { - return beginCreateAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + return createWithResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context) + .block(); } /** * Creates a task for a container registry with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param taskCreateParameters The parameters for creating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. */ @ServiceMethod(returns = ReturnType.SINGLE) public TaskInner create(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { - return createAsync(resourceGroupName, registryName, taskName, taskCreateParameters).block(); + return createWithResponse(resourceGroupName, registryName, taskName, taskCreateParameters, Context.NONE) + .getValue(); } /** - * Creates a task for a container registry with the specified parameters. + * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskCreateParameters The parameters for creating a task. - * @param context The context to associate with this operation. + * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner create(String resourceGroupName, String registryName, String taskName, - TaskInner taskCreateParameters, Context context) { - return createAsync(resourceGroupName, registryName, taskName, taskCreateParameters, context).block(); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all 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) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, - String taskName) { + public Mono> updateWithResponseAsync(String resourceGroupName, String registryName, + String taskName, TaskUpdateParameters taskUpdateParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -693,28 +592,38 @@ public Mono>> deleteWithResponseAsync(String resourceG if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } + if (taskUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null.")); + } else { + taskUpdateParameters.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskName, taskUpdateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a specified task. + * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String registryName, - String taskName, Context context) { + private Mono> updateWithResponseAsync(String resourceGroupName, String registryName, + String taskName, TaskUpdateParameters taskUpdateParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -733,170 +642,93 @@ private Mono>> deleteWithResponseAsync(String resource if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } + if (taskUpdateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null.")); + } else { + taskUpdateParameters.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskName, accept, context); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, - String taskName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, registryName, taskName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String registryName, - String taskName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, registryName, taskName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, - String taskName) { - return this.beginDeleteAsync(resourceGroupName, registryName, taskName).getSyncPoller(); - } - - /** - * Deletes a specified task. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String registryName, - String taskName, Context context) { - return this.beginDeleteAsync(resourceGroupName, registryName, taskName, context).getSyncPoller(); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, taskName, taskUpdateParameters, accept, context); } /** - * Deletes a specified task. + * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String registryName, String taskName) { - return beginDeleteAsync(resourceGroupName, registryName, taskName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono updateAsync(String resourceGroupName, String registryName, String taskName, + TaskUpdateParameters taskUpdateParameters) { + return updateWithResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes a specified task. + * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String registryName, String taskName, Context context) { - return beginDeleteAsync(resourceGroupName, registryName, taskName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public Response updateWithResponse(String resourceGroupName, String registryName, String taskName, + TaskUpdateParameters taskUpdateParameters, Context context) { + return updateWithResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context) + .block(); } /** - * Deletes a specified task. + * Updates a task with the specified parameters. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String taskName) { - deleteAsync(resourceGroupName, registryName, taskName).block(); + public TaskInner update(String resourceGroupName, String registryName, String taskName, + TaskUpdateParameters taskUpdateParameters) { + return updateWithResponse(resourceGroupName, registryName, taskName, taskUpdateParameters, Context.NONE) + .getValue(); } /** * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String registryName, String taskName, Context context) { - deleteAsync(resourceGroupName, registryName, taskName, context).block(); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters) { + public Mono> deleteWithResponseAsync(String resourceGroupName, String registryName, + String taskName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -915,37 +747,28 @@ public Mono>> updateWithResponseAsync(String resourceG if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - if (taskUpdateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null.")); - } else { - taskUpdateParameters.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskName, taskUpdateParameters, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a task with the specified parameters. + * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful - * completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String registryName, String taskName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -964,186 +787,72 @@ private Mono>> updateWithResponseAsync(String resource if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - if (taskUpdateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null.")); - } else { - taskUpdateParameters.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskName, taskUpdateParameters, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, taskName, accept, context); } /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, TaskInner> beginUpdateAsync(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), TaskInner.class, - TaskInner.class, this.client.getContext()); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TaskInner> beginUpdateAsync(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), TaskInner.class, - TaskInner.class, context); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TaskInner> beginUpdate(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters) { - return this.beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).getSyncPoller(); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of the task that has the ARM resource and task properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TaskInner> beginUpdate(String resourceGroupName, String registryName, - String taskName, TaskUpdateParameters taskUpdateParameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context) - .getSyncPoller(); - } - - /** - * Updates a task with the specified parameters. + * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String registryName, String taskName, - TaskUpdateParameters taskUpdateParameters) { - return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono deleteAsync(String resourceGroupName, String registryName, String taskName) { + return deleteWithResponseAsync(resourceGroupName, registryName, taskName).flatMap(ignored -> Mono.empty()); } /** - * Updates a task with the specified parameters. + * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String registryName, String taskName, - TaskUpdateParameters taskUpdateParameters, Context context) { - return beginUpdateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Updates a task with the specified parameters. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner update(String resourceGroupName, String registryName, String taskName, - TaskUpdateParameters taskUpdateParameters) { - return updateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).block(); + public Response deleteWithResponse(String resourceGroupName, String registryName, String taskName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, registryName, taskName, context).block(); } /** - * Updates a task with the specified parameters. + * Deletes a specified task. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. - * @param taskUpdateParameters The parameters for updating a task. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TaskInner update(String resourceGroupName, String registryName, String taskName, - TaskUpdateParameters taskUpdateParameters, Context context) { - return updateAsync(resourceGroupName, registryName, taskName, taskUpdateParameters, context).block(); + public void delete(String resourceGroupName, String registryName, String taskName) { + deleteWithResponse(resourceGroupName, registryName, taskName, Context.NONE); } /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1169,22 +878,23 @@ public Mono> getDetailsWithResponseAsync(String resourceGrou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) + .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response} on successful + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1210,20 +920,21 @@ private Mono> getDetailsWithResponseAsync(String resourceGro } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, this.client.getApiVersion(), taskName, accept, context); + return service.getDetails(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, taskName, accept, context); } /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties on successful completion of {@link Mono}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono getDetailsAsync(String resourceGroupName, String registryName, String taskName) { @@ -1234,14 +945,15 @@ public Mono getDetailsAsync(String resourceGroupName, String registry /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the task that has the ARM resource and task properties along with {@link Response}. + * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getDetailsWithResponse(String resourceGroupName, String registryName, String taskName, @@ -1252,13 +964,14 @@ public Response getDetailsWithResponse(String resourceGroupName, Stri /** * Returns a task with extended information that includes all secrets. * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param registryName The name of the Registry. * @param taskName The name of the container registry task. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. */ @ServiceMethod(returns = ReturnType.SINGLE) public TaskInner getDetails(String resourceGroupName, String registryName, String taskName) { diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java index 2b63c5fea590..327e344409f9 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/IdentityProperties.java @@ -55,17 +55,6 @@ public String principalId() { return this.principalId; } - /** - * Set the principalId property: The principal ID of resource identity. - * - * @param principalId the principalId value to set. - * @return the IdentityProperties object itself. - */ - public IdentityProperties withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - /** * Get the tenantId property: The tenant ID of resource. * @@ -75,17 +64,6 @@ public String tenantId() { return this.tenantId; } - /** - * Set the tenantId property: The tenant ID of resource. - * - * @param tenantId the tenantId value to set. - * @return the IdentityProperties object itself. - */ - public IdentityProperties withTenantId(String tenantId) { - this.tenantId = tenantId; - return this; - } - /** * Get the type property: The identity type. * @@ -155,8 +133,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("principalId", this.principalId); - jsonWriter.writeStringField("tenantId", this.tenantId); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeMapField("userAssignedIdentities", this.userAssignedIdentities, (writer, element) -> writer.writeJson(element)); diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java index af303c2cf5ae..072cee7d75af 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java @@ -14,7 +14,7 @@ import java.util.List; /** - * Collection of runs. + * The collection of runs. */ @Fluent public final class RunListResult implements JsonSerializable { diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java index d247c4287417..dc0f7113a3d9 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java @@ -160,12 +160,12 @@ public static RunRequest fromJson(JsonReader jsonReader) throws IOException { // Use the discriminator value to determine which subtype should be deserialized. if ("DockerBuildRequest".equals(discriminatorValue)) { return DockerBuildRequest.fromJson(readerToUse.reset()); + } else if ("EncodedTaskRunRequest".equals(discriminatorValue)) { + return EncodedTaskRunRequest.fromJson(readerToUse.reset()); } else if ("FileTaskRunRequest".equals(discriminatorValue)) { return FileTaskRunRequest.fromJson(readerToUse.reset()); } else if ("TaskRunRequest".equals(discriminatorValue)) { return TaskRunRequest.fromJson(readerToUse.reset()); - } else if ("EncodedTaskRunRequest".equals(discriminatorValue)) { - return EncodedTaskRunRequest.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java index 90964849843a..3b7a8b35c48c 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java @@ -16,6 +16,13 @@ */ @Fluent public final class SourceRegistryCredentials implements JsonSerializable { + /* + * The Entra identity used for source registry login. + * The value is `[system]` for system-assigned managed identity, `[caller]` for caller identity, + * and client ID for user-assigned managed identity. + */ + private String identity; + /* * The authentication mode which determines the source registry login scope. The credentials for the source registry * will be generated using the given scope. These credentials will be used to login to @@ -29,6 +36,30 @@ public final class SourceRegistryCredentials implements JsonSerializable { /* * The principal id of user assigned identity. @@ -41,17 +41,6 @@ public String principalId() { return this.principalId; } - /** - * Set the principalId property: The principal id of user assigned identity. - * - * @param principalId the principalId value to set. - * @return the UserIdentityProperties object itself. - */ - public UserIdentityProperties withPrincipalId(String principalId) { - this.principalId = principalId; - return this; - } - /** * Get the clientId property: The client id of user assigned identity. * @@ -61,17 +50,6 @@ public String clientId() { return this.clientId; } - /** - * Set the clientId property: The client id of user assigned identity. - * - * @param clientId the clientId value to set. - * @return the UserIdentityProperties object itself. - */ - public UserIdentityProperties withClientId(String clientId) { - this.clientId = clientId; - return this; - } - /** * Validates the instance. * @@ -86,8 +64,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("principalId", this.principalId); - jsonWriter.writeStringField("clientId", this.clientId); return jsonWriter.writeEndObject(); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java index 5f1698ec58e9..5a78c757be5c 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the data models for ContainerRegistryTasksManagementClient. - * null. + * The Microsoft Azure Container Registry management API provides create, read, update, and delete functionality for + * Azure Container Registry resources including registries, replications, webhooks, tasks, runs, and other registry + * components. */ package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java index 5a77c65cbf4b..7a9a74b25877 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/package-info.java @@ -4,6 +4,8 @@ /** * Package containing the classes for ContainerRegistryTasksManagementClient. - * null. + * The Microsoft Azure Container Registry management API provides create, read, update, and delete functionality for + * Azure Container Registry resources including registries, replications, webhooks, tasks, runs, and other registry + * components. */ package com.azure.resourcemanager.containerregistry; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json index b056823a26c0..4bcc116332bd 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.containerregistry.implementation.AgentPoolsClientImpl$AgentPoolsService"],["com.azure.resourcemanager.containerregistry.implementation.RegistryTasksClientImpl$RegistryTasksService"],["com.azure.resourcemanager.containerregistry.implementation.RunsClientImpl$RunsService"],["com.azure.resourcemanager.containerregistry.implementation.TaskRunsClientImpl$TaskRunsService"],["com.azure.resourcemanager.containerregistry.implementation.TasksClientImpl$TasksService"]] \ No newline at end of file +[["com.azure.resourcemanager.containerregistry.implementation.CacheRulesClientImpl$CacheRulesService"],["com.azure.resourcemanager.containerregistry.implementation.ConnectedRegistriesClientImpl$ConnectedRegistriesService"],["com.azure.resourcemanager.containerregistry.implementation.CredentialSetsClientImpl$CredentialSetsService"],["com.azure.resourcemanager.containerregistry.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.containerregistry.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.containerregistry.implementation.RegistriesClientImpl$RegistriesService"],["com.azure.resourcemanager.containerregistry.implementation.ReplicationsClientImpl$ReplicationsService"],["com.azure.resourcemanager.containerregistry.implementation.ScopeMapsClientImpl$ScopeMapsService"],["com.azure.resourcemanager.containerregistry.implementation.TokensClientImpl$TokensService"],["com.azure.resourcemanager.containerregistry.implementation.WebhooksClientImpl$WebhooksService"]] \ No newline at end of file diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/proxy-config.json b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/proxy-config.json new file mode 100644 index 000000000000..b056823a26c0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.containerregistry.implementation.AgentPoolsClientImpl$AgentPoolsService"],["com.azure.resourcemanager.containerregistry.implementation.RegistryTasksClientImpl$RegistryTasksService"],["com.azure.resourcemanager.containerregistry.implementation.RunsClientImpl$RunsService"],["com.azure.resourcemanager.containerregistry.implementation.TaskRunsClientImpl$TaskRunsService"],["com.azure.resourcemanager.containerregistry.implementation.TasksClientImpl$TasksService"]] \ No newline at end of file diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/reflect-config.json b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index 8bc6c4563ef9..385af925d990 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -64,7 +64,7 @@ "dir": "../containerregistry/azure-resourcemanager-containerregistry", "source": "specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/readme.md", "package": "com.azure.resourcemanager.containerregistry", - "args": "--tag=package-2019-06-preview --modelerfour.lenient-model-deduplication=true --graalvm-config-suffix=registrytasks --enable-sync-stack=false" + "args": "--tag=package-2025-03-preview --modelerfour.lenient-model-deduplication=true --graalvm-config-suffix=registrytasks --enable-sync-stack=false" }, "containerregistry-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-containerregistry",