From 6f2a0569e96ea0fa9e8e01a28f107d14154e9e67 Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Fri, 6 Nov 2020 18:58:19 +0000 Subject: [PATCH] Generated from 69b2a91b5e1c4cd03e901aedfbedc4fdb6622178 --- .../mgmt-v2019_06_01_preview/pom.xml | 4 +- .../v2019_06_01_preview/AgentPool.java | 220 ++++ .../AgentPoolQueueStatus.java | 25 + .../AgentPoolUpdateParameters.java | 72 ++ .../v2019_06_01_preview/AgentPools.java | 64 + .../DockerBuildRequest.java | 2 +- .../v2019_06_01_preview/DockerBuildStep.java | 2 +- .../DockerBuildStepUpdateParameters.java | 2 +- .../EncodedTaskRunRequest.java | 2 +- .../v2019_06_01_preview/EncodedTaskStep.java | 2 +- .../EncodedTaskStepUpdateParameters.java | 2 +- .../v2019_06_01_preview/ErrorResponse.java | 43 + .../ErrorResponseBody.java | 122 ++ .../ErrorResponseException.java | 44 + .../FileTaskRunRequest.java | 2 +- .../v2019_06_01_preview/FileTaskStep.java | 2 +- .../FileTaskStepUpdateParameters.java | 2 +- .../InnerErrorDescription.java | 95 ++ .../v2019_06_01_preview/Run.java | 10 + .../v2019_06_01_preview/RunFilter.java | 26 + .../v2019_06_01_preview/RunGetLogResult.java | 5 + .../v2019_06_01_preview/RunRequest.java | 55 +- .../v2019_06_01_preview/Task.java | 131 +- .../v2019_06_01_preview/TaskRun.java | 227 ++++ .../v2019_06_01_preview/TaskRunRequest.java | 2 +- .../TaskRunUpdateParameters.java | 151 +++ .../v2019_06_01_preview/TaskRuns.java | 64 + .../TaskStepProperties.java | 2 +- .../TaskStepUpdateParameters.java | 2 +- .../TaskUpdateParameters.java | 53 + .../implementation/AgentPoolImpl.java | 198 +++ .../implementation/AgentPoolInner.java | 143 +++ .../AgentPoolQueueStatusImpl.java | 31 + .../AgentPoolQueueStatusInner.java | 43 + .../implementation/AgentPoolsImpl.java | 98 ++ .../implementation/AgentPoolsInner.java | 1070 +++++++++++++++++ ...ContainerRegistryManagementClientImpl.java | 28 + .../ContainerRegistryManager.java | 24 + .../implementation/RegistriesInner.java | 20 +- .../implementation/RunGetLogResultImpl.java | 5 + .../implementation/RunGetLogResultInner.java | 26 + .../implementation/RunImpl.java | 10 + .../implementation/RunInner.java | 41 + .../implementation/RunsInner.java | 60 +- .../implementation/TaskImpl.java | 41 + .../implementation/TaskInner.java | 84 +- .../implementation/TaskRunImpl.java | 202 ++++ .../implementation/TaskRunInner.java | 160 +++ .../implementation/TaskRunsImpl.java | 97 ++ .../implementation/TaskRunsInner.java | 1070 +++++++++++++++++ .../implementation/TasksInner.java | 64 +- 51 files changed, 4833 insertions(+), 117 deletions(-) create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPool.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPoolQueueStatus.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPoolUpdateParameters.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPools.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponse.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponseBody.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponseException.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/InnerErrorDescription.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRun.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRunUpdateParameters.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRuns.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolImpl.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolInner.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolQueueStatusImpl.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolQueueStatusInner.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolsImpl.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolsInner.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunImpl.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunInner.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunsImpl.java create mode 100644 sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunsInner.java diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/pom.xml b/sdk/containerregistry/mgmt-v2019_06_01_preview/pom.xml index 89090056643a..3c7e9344faaf 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/pom.xml +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/pom.xml @@ -11,8 +11,8 @@ com.microsoft.azure azure-arm-parent - 1.2.0 - ../../parents/azure-arm-parent + 1.1.0 + ../../../pom.management.xml azure-mgmt-containerregistry 1.0.0-beta diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPool.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPool.java new file mode 100644 index 000000000000..b2cad635432d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPool.java @@ -0,0 +1,220 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation.AgentPoolInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; + +/** + * Type representing AgentPool. + */ +public interface AgentPool extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the count value. + */ + Integer count(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the os value. + */ + OS os(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the tier value. + */ + String tier(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the virtualNetworkSubnetResourceId value. + */ + String virtualNetworkSubnetResourceId(); + + /** + * The entirety of the AgentPool definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of AgentPool definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a AgentPool definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the agentpool definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + * @param resourceGroupName The name of the resource group to which the container registry belongs + * @param registryName The name of the container registry + * @return the next definition stage + */ + WithLocation withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the agentpool definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource. This cannot be changed after the resource is created + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the agentpool definition allowing to specify Count. + */ + interface WithCount { + /** + * Specifies count. + * @param count The count of agent machine + * @return the next definition stage + */ + WithCreate withCount(Integer count); + } + + /** + * The stage of the agentpool definition allowing to specify Os. + */ + interface WithOs { + /** + * Specifies os. + * @param os The OS of agent machine. Possible values include: 'Windows', 'Linux' + * @return the next definition stage + */ + WithCreate withOs(OS os); + } + + /** + * The stage of the agentpool definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the agentpool definition allowing to specify Tier. + */ + interface WithTier { + /** + * Specifies tier. + * @param tier The Tier of agent machine + * @return the next definition stage + */ + WithCreate withTier(String tier); + } + + /** + * The stage of the agentpool definition allowing to specify VirtualNetworkSubnetResourceId. + */ + interface WithVirtualNetworkSubnetResourceId { + /** + * Specifies virtualNetworkSubnetResourceId. + * @param virtualNetworkSubnetResourceId The Virtual Network Subnet Resource Id of the agent machine + * @return the next definition stage + */ + WithCreate withVirtualNetworkSubnetResourceId(String virtualNetworkSubnetResourceId); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCount, DefinitionStages.WithOs, DefinitionStages.WithTags, DefinitionStages.WithTier, DefinitionStages.WithVirtualNetworkSubnetResourceId { + } + } + /** + * The template for a AgentPool update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCount, UpdateStages.WithTags { + } + + /** + * Grouping of AgentPool update stages. + */ + interface UpdateStages { + /** + * The stage of the agentpool update allowing to specify Count. + */ + interface WithCount { + /** + * Specifies count. + * @param count The count of agent machine + * @return the next update stage + */ + Update withCount(Integer count); + } + + /** + * The stage of the agentpool update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The ARM resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPoolQueueStatus.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPoolQueueStatus.java new file mode 100644 index 000000000000..dd867d239e84 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPoolQueueStatus.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation.AgentPoolQueueStatusInner; + +/** + * Type representing AgentPoolQueueStatus. + */ +public interface AgentPoolQueueStatus extends HasInner, HasManager { + /** + * @return the count value. + */ + Integer count(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPoolUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPoolUpdateParameters.java new file mode 100644 index 000000000000..7216315d31d5 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPoolUpdateParameters.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating an agent pool. + */ +@JsonFlatten +public class AgentPoolUpdateParameters { + /** + * The count of agent machine. + */ + @JsonProperty(value = "properties.count") + private Integer count; + + /** + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the count of agent machine. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of agent machine. + * + * @param count the count value to set + * @return the AgentPoolUpdateParameters object itself. + */ + public AgentPoolUpdateParameters withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the ARM resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the ARM resource tags. + * + * @param tags the tags value to set + * @return the AgentPoolUpdateParameters object itself. + */ + public AgentPoolUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPools.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPools.java new file mode 100644 index 000000000000..172f53f38228 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/AgentPools.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation.AgentPoolsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing AgentPools. + */ +public interface AgentPools extends SupportsCreating, HasInner { + /** + * 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 agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getQueueStatusAsync(String resourceGroupName, String registryName, String agentPoolName); + + /** + * 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 agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String agentPoolName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String agentPoolName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildRequest.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildRequest.java index 24153a9cc340..aab6bc47c7a4 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildRequest.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildRequest.java @@ -16,7 +16,7 @@ /** * The parameters for a docker quick build. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = DockerBuildRequest.class) @JsonTypeName("DockerBuildRequest") public class DockerBuildRequest extends RunRequest { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildStep.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildStep.java index 0f974218f0fd..e454f453c9d7 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildStep.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildStep.java @@ -16,7 +16,7 @@ /** * The Docker build step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = DockerBuildStep.class) @JsonTypeName("Docker") public class DockerBuildStep extends TaskStepProperties { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildStepUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildStepUpdateParameters.java index c10def6386e6..e01d36d462ef 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildStepUpdateParameters.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/DockerBuildStepUpdateParameters.java @@ -16,7 +16,7 @@ /** * The properties for updating a docker build step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = DockerBuildStepUpdateParameters.class) @JsonTypeName("Docker") public class DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskRunRequest.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskRunRequest.java index 8b3d349be660..ae26dae84477 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskRunRequest.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskRunRequest.java @@ -16,7 +16,7 @@ /** * The parameters for a quick task run request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = EncodedTaskRunRequest.class) @JsonTypeName("EncodedTaskRunRequest") public class EncodedTaskRunRequest extends RunRequest { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskStep.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskStep.java index ce55407fe280..6554c126455d 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskStep.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskStep.java @@ -16,7 +16,7 @@ /** * The properties of a encoded task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = EncodedTaskStep.class) @JsonTypeName("EncodedTask") public class EncodedTaskStep extends TaskStepProperties { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskStepUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskStepUpdateParameters.java index 771c96b38c40..f88088f5a18a 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskStepUpdateParameters.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/EncodedTaskStepUpdateParameters.java @@ -16,7 +16,7 @@ /** * The properties for updating encoded task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = EncodedTaskStepUpdateParameters.class) @JsonTypeName("EncodedTask") public class EncodedTaskStepUpdateParameters extends TaskStepUpdateParameters { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponse.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponse.java new file mode 100644 index 000000000000..830e6254103a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from the Azure Container Registry service. + */ +public class ErrorResponse { + /** + * Azure container registry build API error body. + */ + @JsonProperty(value = "error") + private ErrorResponseBody error; + + /** + * Get azure container registry build API error body. + * + * @return the error value + */ + public ErrorResponseBody error() { + return this.error; + } + + /** + * Set azure container registry build API error body. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(ErrorResponseBody error) { + this.error = error; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponseBody.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponseBody.java new file mode 100644 index 000000000000..1514f4a04667 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponseBody.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from the Azure Container Registry service. + */ +public class ErrorResponseBody { + /** + * error code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * target of the particular error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * an array of additional nested error response info objects, as described + * by this contract. + */ + @JsonProperty(value = "details") + private InnerErrorDescription details; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get target of the particular error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set target of the particular error. + * + * @param target the target value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get an array of additional nested error response info objects, as described by this contract. + * + * @return the details value + */ + public InnerErrorDescription details() { + return this.details; + } + + /** + * Set an array of additional nested error response info objects, as described by this contract. + * + * @param details the details value to set + * @return the ErrorResponseBody object itself. + */ + public ErrorResponseBody withDetails(InnerErrorDescription details) { + this.details = details; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponseException.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponseException.java new file mode 100644 index 000000000000..a3e4b6db9d60 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/ErrorResponseException.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorResponse information. + */ +public class ErrorResponseException extends RestException { + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorResponseException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorResponseException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + * @param body the deserialized response body + */ + public ErrorResponseException(final String message, final Response response, final ErrorResponse body) { + super(message, response, body); + } + + @Override + public ErrorResponse body() { + return (ErrorResponse) super.body(); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskRunRequest.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskRunRequest.java index 16855f139bf1..0812454824c5 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskRunRequest.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskRunRequest.java @@ -16,7 +16,7 @@ /** * The request parameters for a scheduling run against a task file. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = FileTaskRunRequest.class) @JsonTypeName("FileTaskRunRequest") public class FileTaskRunRequest extends RunRequest { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskStep.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskStep.java index 75f4a8744ccb..01b261784412 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskStep.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskStep.java @@ -16,7 +16,7 @@ /** * The properties of a task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = FileTaskStep.class) @JsonTypeName("FileTask") public class FileTaskStep extends TaskStepProperties { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskStepUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskStepUpdateParameters.java index 3b86d4c25efb..8838b330991a 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskStepUpdateParameters.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/FileTaskStepUpdateParameters.java @@ -16,7 +16,7 @@ /** * The properties of updating a task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = FileTaskStepUpdateParameters.class) @JsonTypeName("FileTask") public class FileTaskStepUpdateParameters extends TaskStepUpdateParameters { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/InnerErrorDescription.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/InnerErrorDescription.java new file mode 100644 index 000000000000..2389870ccc7b --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/InnerErrorDescription.java @@ -0,0 +1,95 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * inner error. + */ +public class InnerErrorDescription { + /** + * error code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * target of the particular error. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get error code. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set error code. + * + * @param code the code value to set + * @return the InnerErrorDescription object itself. + */ + public InnerErrorDescription withCode(String code) { + this.code = code; + return this; + } + + /** + * Get error message. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set error message. + * + * @param message the message value to set + * @return the InnerErrorDescription object itself. + */ + public InnerErrorDescription withMessage(String message) { + this.message = message; + return this; + } + + /** + * Get target of the particular error. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set target of the particular error. + * + * @param target the target value to set + * @return the InnerErrorDescription object itself. + */ + public InnerErrorDescription withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/Run.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/Run.java index 45333905cee9..cf78a899ffb4 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/Run.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/Run.java @@ -28,6 +28,11 @@ public interface Run extends HasInner, Indexable, Refreshable, Up */ AgentProperties agentConfiguration(); + /** + * @return the agentPoolName value. + */ + String agentPoolName(); + /** * @return the createTime value. */ @@ -63,6 +68,11 @@ public interface Run extends HasInner, Indexable, Refreshable, Up */ DateTime lastUpdatedTime(); + /** + * @return the logArtifact value. + */ + ImageDescriptor logArtifact(); + /** * @return the name value. */ diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunFilter.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunFilter.java index 61b72c29388d..26cbeeead565 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunFilter.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunFilter.java @@ -68,6 +68,12 @@ public class RunFilter { @JsonProperty(value = "taskName") private String taskName; + /** + * The name of the agent pool that the run corresponds to. + */ + @JsonProperty(value = "agentPoolName") + private String agentPoolName; + /** * Get the unique identifier for the run. * @@ -230,4 +236,24 @@ public RunFilter withTaskName(String taskName) { return this; } + /** + * Get the name of the agent pool that the run corresponds to. + * + * @return the agentPoolName value + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the name of the agent pool that the run corresponds to. + * + * @param agentPoolName the agentPoolName value to set + * @return the RunFilter object itself. + */ + public RunFilter withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + } diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunGetLogResult.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunGetLogResult.java index 77765b57d4f3..78cee348a4c1 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunGetLogResult.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunGetLogResult.java @@ -17,6 +17,11 @@ * Type representing RunGetLogResult. */ public interface RunGetLogResult extends HasInner, HasManager { + /** + * @return the logArtifactLink value. + */ + String logArtifactLink(); + /** * @return the logLink value. */ diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunRequest.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunRequest.java index d9efbd055415..86690f83c846 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunRequest.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/RunRequest.java @@ -16,7 +16,7 @@ /** * The request parameters for scheduling a run. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = RunRequest.class) @JsonTypeName("RunRequest") @JsonSubTypes({ @JsonSubTypes.Type(name = "DockerBuildRequest", value = DockerBuildRequest.class), @@ -32,6 +32,19 @@ public class RunRequest { @JsonProperty(value = "isArchiveEnabled") private Boolean isArchiveEnabled; + /** + * The dedicated agent pool for the run. + */ + @JsonProperty(value = "agentPoolName") + private String agentPoolName; + + /** + * The template that describes the repository and tag information for run + * log artifact. + */ + @JsonProperty(value = "logTemplate") + private String logTemplate; + /** * Get the value that indicates whether archiving is enabled for the run or not. * @@ -52,4 +65,44 @@ public RunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { return this; } + /** + * Get the dedicated agent pool for the run. + * + * @return the agentPoolName value + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the dedicated agent pool for the run. + * + * @param agentPoolName the agentPoolName value to set + * @return the RunRequest object itself. + */ + public RunRequest withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + + /** + * Get the template that describes the repository and tag information for run log artifact. + * + * @return the logTemplate value + */ + public String logTemplate() { + return this.logTemplate; + } + + /** + * Set the template that describes the repository and tag information for run log artifact. + * + * @param logTemplate the logTemplate value to set + * @return the RunRequest object itself. + */ + public RunRequest withLogTemplate(String logTemplate) { + this.logTemplate = logTemplate; + return this; + } + } diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/Task.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/Task.java index 3f46bdec6bbe..eccc4e3163f8 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/Task.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/Task.java @@ -29,6 +29,11 @@ public interface Task extends HasInner, Indexable, Refreshable, */ AgentProperties agentConfiguration(); + /** + * @return the agentPoolName value. + */ + String agentPoolName(); + /** * @return the creationDate value. */ @@ -49,11 +54,21 @@ public interface Task extends HasInner, Indexable, Refreshable, */ IdentityProperties identity(); + /** + * @return the isSystemTask value. + */ + Boolean isSystemTask(); + /** * @return the location value. */ String location(); + /** + * @return the logTemplate value. + */ + String logTemplate(); + /** * @return the name value. */ @@ -102,7 +117,7 @@ public interface Task extends HasInner, Indexable, Refreshable, /** * The entirety of the Task definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithPlatform, DefinitionStages.WithStep, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate { } /** @@ -137,31 +152,7 @@ interface WithLocation { * @param location The location of the resource. This cannot be changed after the resource is created * @return the next definition stage */ - WithPlatform withLocation(String location); - } - - /** - * The stage of the task definition allowing to specify Platform. - */ - interface WithPlatform { - /** - * Specifies platform. - * @param platform The platform properties against which the run has to happen - * @return the next definition stage - */ - WithStep withPlatform(PlatformProperties platform); - } - - /** - * The stage of the task definition allowing to specify Step. - */ - interface WithStep { - /** - * Specifies step. - * @param step The properties of a task step - * @return the next definition stage - */ - WithCreate withStep(TaskStepProperties step); + WithCreate withLocation(String location); } /** @@ -176,6 +167,18 @@ interface WithAgentConfiguration { WithCreate withAgentConfiguration(AgentProperties agentConfiguration); } + /** + * The stage of the task definition allowing to specify AgentPoolName. + */ + interface WithAgentPoolName { + /** + * Specifies agentPoolName. + * @param agentPoolName The dedicated agent pool for the task + * @return the next definition stage + */ + WithCreate withAgentPoolName(String agentPoolName); + } + /** * The stage of the task definition allowing to specify Credentials. */ @@ -200,6 +203,42 @@ interface WithIdentity { WithCreate withIdentity(IdentityProperties identity); } + /** + * The stage of the task definition allowing to specify IsSystemTask. + */ + interface WithIsSystemTask { + /** + * Specifies isSystemTask. + * @param isSystemTask The value of this property indicates whether the task resource is system task or not + * @return the next definition stage + */ + WithCreate withIsSystemTask(Boolean isSystemTask); + } + + /** + * The stage of the task definition allowing to specify LogTemplate. + */ + interface WithLogTemplate { + /** + * Specifies logTemplate. + * @param logTemplate The template that describes the repository and tag information for run log artifact + * @return the next definition stage + */ + WithCreate withLogTemplate(String logTemplate); + } + + /** + * The stage of the task definition allowing to specify Platform. + */ + interface WithPlatform { + /** + * Specifies platform. + * @param platform The platform properties against which the run has to happen + * @return the next definition stage + */ + WithCreate withPlatform(PlatformProperties platform); + } + /** * The stage of the task definition allowing to specify Status. */ @@ -212,6 +251,18 @@ interface WithStatus { WithCreate withStatus(TaskStatus status); } + /** + * The stage of the task definition allowing to specify Step. + */ + interface WithStep { + /** + * Specifies step. + * @param step The properties of a task step + * @return the next definition stage + */ + WithCreate withStep(TaskStepProperties step); + } + /** * The stage of the task definition allowing to specify Tags. */ @@ -253,13 +304,13 @@ interface WithTrigger { * the resource to be created (via {@link WithCreate#create()}), but also allows * for any other optional settings to be specified. */ - interface WithCreate extends Creatable, DefinitionStages.WithAgentConfiguration, DefinitionStages.WithCredentials, DefinitionStages.WithIdentity, DefinitionStages.WithStatus, DefinitionStages.WithTags, DefinitionStages.WithTimeout, DefinitionStages.WithTrigger { + interface WithCreate extends Creatable, DefinitionStages.WithAgentConfiguration, DefinitionStages.WithAgentPoolName, DefinitionStages.WithCredentials, DefinitionStages.WithIdentity, DefinitionStages.WithIsSystemTask, DefinitionStages.WithLogTemplate, DefinitionStages.WithPlatform, DefinitionStages.WithStatus, DefinitionStages.WithStep, DefinitionStages.WithTags, DefinitionStages.WithTimeout, DefinitionStages.WithTrigger { } } /** * The template for a Task update operation, containing all the settings that can be modified. */ - interface Update extends Appliable, UpdateStages.WithAgentConfiguration, UpdateStages.WithCredentials, UpdateStages.WithIdentity, UpdateStages.WithPlatform, UpdateStages.WithStatus, UpdateStages.WithStep, UpdateStages.WithTags, UpdateStages.WithTimeout, UpdateStages.WithTrigger { + interface Update extends Appliable, UpdateStages.WithAgentConfiguration, UpdateStages.WithAgentPoolName, UpdateStages.WithCredentials, UpdateStages.WithIdentity, UpdateStages.WithLogTemplate, UpdateStages.WithPlatform, UpdateStages.WithStatus, UpdateStages.WithStep, UpdateStages.WithTags, UpdateStages.WithTimeout, UpdateStages.WithTrigger { } /** @@ -278,6 +329,18 @@ interface WithAgentConfiguration { Update withAgentConfiguration(AgentProperties agentConfiguration); } + /** + * The stage of the task update allowing to specify AgentPoolName. + */ + interface WithAgentPoolName { + /** + * Specifies agentPoolName. + * @param agentPoolName The dedicated agent pool for the task + * @return the next update stage + */ + Update withAgentPoolName(String agentPoolName); + } + /** * The stage of the task update allowing to specify Credentials. */ @@ -302,6 +365,18 @@ interface WithIdentity { Update withIdentity(IdentityProperties identity); } + /** + * The stage of the task update allowing to specify LogTemplate. + */ + interface WithLogTemplate { + /** + * Specifies logTemplate. + * @param logTemplate The template that describes the repository and tag information for run log artifact + * @return the next update stage + */ + Update withLogTemplate(String logTemplate); + } + /** * The stage of the task update allowing to specify Platform. */ diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRun.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRun.java new file mode 100644 index 000000000000..6a2c4ebb3667 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRun.java @@ -0,0 +1,227 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation.TaskRunInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; + +/** + * Type representing TaskRun. + */ +public interface TaskRun extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the forceUpdateTag value. + */ + String forceUpdateTag(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the runRequest value. + */ + RunRequest runRequest(); + + /** + * @return the runResult value. + */ + Run runResult(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the TaskRun definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithCreate { + } + + /** + * Grouping of TaskRun definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a TaskRun definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the taskrun definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + * @param resourceGroupName The name of the resource group to which the container registry belongs + * @param registryName The name of the container registry + * @return the next definition stage + */ + WithCreate withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the taskrun definition allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the run should be forced to rerun even if the run request configuration has not changed + * @return the next definition stage + */ + WithCreate withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the taskrun definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity Identity for the resource + * @return the next definition stage + */ + WithCreate withIdentity(IdentityProperties identity); + } + + /** + * The stage of the taskrun definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next definition stage + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the taskrun definition allowing to specify RunRequest. + */ + interface WithRunRequest { + /** + * Specifies runRequest. + * @param runRequest The request (parameters) for the run + * @return the next definition stage + */ + WithCreate withRunRequest(RunRequest runRequest); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithForceUpdateTag, DefinitionStages.WithIdentity, DefinitionStages.WithLocation, DefinitionStages.WithRunRequest { + } + } + /** + * The template for a TaskRun update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithForceUpdateTag, UpdateStages.WithIdentity, UpdateStages.WithLocation, UpdateStages.WithRunRequest, UpdateStages.WithTags { + } + + /** + * Grouping of TaskRun update stages. + */ + interface UpdateStages { + /** + * The stage of the taskrun update allowing to specify ForceUpdateTag. + */ + interface WithForceUpdateTag { + /** + * Specifies forceUpdateTag. + * @param forceUpdateTag How the run should be forced to rerun even if the run request configuration has not changed + * @return the next update stage + */ + Update withForceUpdateTag(String forceUpdateTag); + } + + /** + * The stage of the taskrun update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity Identity for the resource + * @return the next update stage + */ + Update withIdentity(IdentityProperties identity); + } + + /** + * The stage of the taskrun update allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the resource + * @return the next update stage + */ + Update withLocation(String location); + } + + /** + * The stage of the taskrun update allowing to specify RunRequest. + */ + interface WithRunRequest { + /** + * Specifies runRequest. + * @param runRequest The request (parameters) for the new run + * @return the next update stage + */ + Update withRunRequest(RunRequest runRequest); + } + + /** + * The stage of the taskrun update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The ARM resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRunRequest.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRunRequest.java index b735a000f83b..525008ba0d1c 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRunRequest.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRunRequest.java @@ -15,7 +15,7 @@ /** * The parameters for a task run request. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = TaskRunRequest.class) @JsonTypeName("TaskRunRequest") public class TaskRunRequest extends RunRequest { /** diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRunUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRunUpdateParameters.java new file mode 100644 index 000000000000..cc6381e95df6 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRunUpdateParameters.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a task run. + */ +@JsonFlatten +public class TaskRunUpdateParameters { + /** + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** + * The request (parameters) for the new run. + */ + @JsonProperty(value = "properties.runRequest") + private RunRequest runRequest; + + /** + * How the run should be forced to rerun even if the run request + * configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * The location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /** + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get identity for the resource. + * + * @return the identity value + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set identity for the resource. + * + * @param identity the identity value to set + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the request (parameters) for the new run. + * + * @return the runRequest value + */ + public RunRequest runRequest() { + return this.runRequest; + } + + /** + * Set the request (parameters) for the new run. + * + * @param runRequest the runRequest value to set + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withRunRequest(RunRequest runRequest) { + this.runRequest = runRequest; + return this; + } + + /** + * Get how the run should be forced to rerun even if the run request configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the run should be forced to rerun even if the run request configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the location of the resource. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the resource. + * + * @param location the location value to set + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the ARM resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the ARM resource tags. + * + * @param tags the tags value to set + * @return the TaskRunUpdateParameters object itself. + */ + public TaskRunUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRuns.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRuns.java new file mode 100644 index 000000000000..df21ed687bf7 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskRuns.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation.TaskRunsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing TaskRuns. + */ +public interface TaskRuns extends SupportsCreating, HasInner { + /** + * 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 taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDetailsAsync(String resourceGroupName, String registryName, String taskRunName); + + /** + * 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 taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String taskRunName); + + /** + * 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 + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * 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 + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String taskRunName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskStepProperties.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskStepProperties.java index bbc3fd09a887..f668f61efa13 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskStepProperties.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskStepProperties.java @@ -17,7 +17,7 @@ /** * Base properties for any task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = TaskStepProperties.class) @JsonTypeName("TaskStepProperties") @JsonSubTypes({ @JsonSubTypes.Type(name = "Docker", value = DockerBuildStep.class), diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskStepUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskStepUpdateParameters.java index 64cf2dc8d8f3..1a986e53d52f 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskStepUpdateParameters.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskStepUpdateParameters.java @@ -16,7 +16,7 @@ /** * Base properties for updating any task step. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = TaskStepUpdateParameters.class) @JsonTypeName("TaskStepUpdateParameters") @JsonSubTypes({ @JsonSubTypes.Type(name = "Docker", value = DockerBuildStepUpdateParameters.class), diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskUpdateParameters.java index adfdebb5903e..96c65c919c27 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskUpdateParameters.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/TaskUpdateParameters.java @@ -42,6 +42,12 @@ public class TaskUpdateParameters { @JsonProperty(value = "properties.agentConfiguration") private AgentProperties agentConfiguration; + /** + * The dedicated agent pool for the task. + */ + @JsonProperty(value = "properties.agentPoolName") + private String agentPoolName; + /** * Run timeout in seconds. */ @@ -67,6 +73,13 @@ public class TaskUpdateParameters { @JsonProperty(value = "properties.credentials") private Credentials credentials; + /** + * The template that describes the repository and tag information for run + * log artifact. + */ + @JsonProperty(value = "properties.logTemplate") + private String logTemplate; + /** * The ARM resource tags. */ @@ -153,6 +166,26 @@ public TaskUpdateParameters withAgentConfiguration(AgentProperties agentConfigur return this; } + /** + * Get the dedicated agent pool for the task. + * + * @return the agentPoolName value + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the dedicated agent pool for the task. + * + * @param agentPoolName the agentPoolName value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + /** * Get run timeout in seconds. * @@ -233,6 +266,26 @@ public TaskUpdateParameters withCredentials(Credentials credentials) { return this; } + /** + * Get the template that describes the repository and tag information for run log artifact. + * + * @return the logTemplate value + */ + public String logTemplate() { + return this.logTemplate; + } + + /** + * Set the template that describes the repository and tag information for run log artifact. + * + * @param logTemplate the logTemplate value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withLogTemplate(String logTemplate) { + this.logTemplate = logTemplate; + return this; + } + /** * Get the ARM resource tags. * diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolImpl.java new file mode 100644 index 000000000000..1e269ded8b44 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolImpl.java @@ -0,0 +1,198 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPool; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPoolUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.OS; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ProvisioningState; +import rx.functions.Func1; + +class AgentPoolImpl extends CreatableUpdatableImpl implements AgentPool, AgentPool.Definition, AgentPool.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String agentPoolName; + private AgentPoolUpdateParameters updateParameter; + + AgentPoolImpl(String name, ContainerRegistryManager manager) { + super(name, new AgentPoolInner()); + this.manager = manager; + // Set resource name + this.agentPoolName = name; + // + this.updateParameter = new AgentPoolUpdateParameters(); + } + + AgentPoolImpl(AgentPoolInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.agentPoolName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.agentPoolName = IdParsingUtils.getValueFromIdByName(inner.id(), "agentPools"); + // + this.updateParameter = new AgentPoolUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + AgentPoolsInner client = this.manager().inner().agentPools(); + return client.createAsync(this.resourceGroupName, this.registryName, this.agentPoolName, this.inner()) + .map(new Func1() { + @Override + public AgentPoolInner call(AgentPoolInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + AgentPoolsInner client = this.manager().inner().agentPools(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.agentPoolName, this.updateParameter) + .map(new Func1() { + @Override + public AgentPoolInner call(AgentPoolInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + AgentPoolsInner client = this.manager().inner().agentPools(); + return client.getAsync(this.resourceGroupName, this.registryName, this.agentPoolName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new AgentPoolUpdateParameters(); + } + + @Override + public Integer count() { + return this.inner().count(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public OS os() { + return this.inner().os(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String tier() { + return this.inner().tier(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String virtualNetworkSubnetResourceId() { + return this.inner().virtualNetworkSubnetResourceId(); + } + + @Override + public AgentPoolImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public AgentPoolImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public AgentPoolImpl withOs(OS os) { + this.inner().withOs(os); + return this; + } + + @Override + public AgentPoolImpl withTier(String tier) { + this.inner().withTier(tier); + return this; + } + + @Override + public AgentPoolImpl withVirtualNetworkSubnetResourceId(String virtualNetworkSubnetResourceId) { + this.inner().withVirtualNetworkSubnetResourceId(virtualNetworkSubnetResourceId); + return this; + } + + @Override + public AgentPoolImpl withCount(Integer count) { + if (isInCreateMode()) { + this.inner().withCount(count); + } else { + this.updateParameter.withCount(count); + } + return this; + } + + @Override + public AgentPoolImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolInner.java new file mode 100644 index 000000000000..019baeca5ab3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolInner.java @@ -0,0 +1,143 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.OS; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The agentpool that has the ARM resource and properties. + * The agentpool will have all information to create an agent pool. + */ +@JsonFlatten +public class AgentPoolInner extends Resource { + /** + * The count of agent machine. + */ + @JsonProperty(value = "properties.count") + private Integer count; + + /** + * The Tier of agent machine. + */ + @JsonProperty(value = "properties.tier") + private String tier; + + /** + * The OS of agent machine. Possible values include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "properties.os") + private OS os; + + /** + * The Virtual Network Subnet Resource Id of the agent machine. + */ + @JsonProperty(value = "properties.virtualNetworkSubnetResourceId") + private String virtualNetworkSubnetResourceId; + + /** + * The provisioning state of this agent pool. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the count of agent machine. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the count of agent machine. + * + * @param count the count value to set + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withCount(Integer count) { + this.count = count; + return this; + } + + /** + * Get the Tier of agent machine. + * + * @return the tier value + */ + public String tier() { + return this.tier; + } + + /** + * Set the Tier of agent machine. + * + * @param tier the tier value to set + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withTier(String tier) { + this.tier = tier; + return this; + } + + /** + * Get the OS of agent machine. Possible values include: 'Windows', 'Linux'. + * + * @return the os value + */ + public OS os() { + return this.os; + } + + /** + * Set the OS of agent machine. Possible values include: 'Windows', 'Linux'. + * + * @param os the os value to set + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withOs(OS os) { + this.os = os; + return this; + } + + /** + * Get the Virtual Network Subnet Resource Id of the agent machine. + * + * @return the virtualNetworkSubnetResourceId value + */ + public String virtualNetworkSubnetResourceId() { + return this.virtualNetworkSubnetResourceId; + } + + /** + * Set the Virtual Network Subnet Resource Id of the agent machine. + * + * @param virtualNetworkSubnetResourceId the virtualNetworkSubnetResourceId value to set + * @return the AgentPoolInner object itself. + */ + public AgentPoolInner withVirtualNetworkSubnetResourceId(String virtualNetworkSubnetResourceId) { + this.virtualNetworkSubnetResourceId = virtualNetworkSubnetResourceId; + return this; + } + + /** + * Get the provisioning state of this agent pool. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolQueueStatusImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolQueueStatusImpl.java new file mode 100644 index 000000000000..00ef85b85d6e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolQueueStatusImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPoolQueueStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class AgentPoolQueueStatusImpl extends WrapperImpl implements AgentPoolQueueStatus { + private final ContainerRegistryManager manager; + AgentPoolQueueStatusImpl(AgentPoolQueueStatusInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Integer count() { + return this.inner().count(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolQueueStatusInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolQueueStatusInner.java new file mode 100644 index 000000000000..5f9dacc1c588 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolQueueStatusInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The QueueStatus of Agent Pool. + */ +public class AgentPoolQueueStatusInner { + /** + * The number of pending runs in the queue. + */ + @JsonProperty(value = "count") + private Integer count; + + /** + * Get the number of pending runs in the queue. + * + * @return the count value + */ + public Integer count() { + return this.count; + } + + /** + * Set the number of pending runs in the queue. + * + * @param count the count value to set + * @return the AgentPoolQueueStatusInner object itself. + */ + public AgentPoolQueueStatusInner withCount(Integer count) { + this.count = count; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolsImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolsImpl.java new file mode 100644 index 000000000000..7003f1817be7 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolsImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPoolQueueStatus; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPool; + +class AgentPoolsImpl extends WrapperImpl implements AgentPools { + private final ContainerRegistryManager manager; + + AgentPoolsImpl(ContainerRegistryManager manager) { + super(manager.inner().agentPools()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public AgentPoolImpl define(String name) { + return wrapModel(name); + } + + private AgentPoolImpl wrapModel(AgentPoolInner inner) { + return new AgentPoolImpl(inner, manager()); + } + + private AgentPoolImpl wrapModel(String name) { + return new AgentPoolImpl(name, this.manager()); + } + + @Override + public Observable getQueueStatusAsync(String resourceGroupName, String registryName, String agentPoolName) { + AgentPoolsInner client = this.inner(); + return client.getQueueStatusAsync(resourceGroupName, registryName, agentPoolName) + .map(new Func1() { + @Override + public AgentPoolQueueStatus call(AgentPoolQueueStatusInner inner) { + return new AgentPoolQueueStatusImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + AgentPoolsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public AgentPool call(AgentPoolInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String agentPoolName) { + AgentPoolsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, agentPoolName) + .flatMap(new Func1>() { + @Override + public Observable call(AgentPoolInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((AgentPool)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String agentPoolName) { + AgentPoolsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, agentPoolName).toCompletable(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolsInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolsInner.java new file mode 100644 index 000000000000..620d4bfb35c0 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/AgentPoolsInner.java @@ -0,0 +1,1070 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPoolUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in AgentPools. + */ +public class AgentPoolsInner { + /** The Retrofit service to perform REST calls. */ + private AgentPoolsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of AgentPoolsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public AgentPoolsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(AgentPoolsService.class); + this.client = client; + } + + /** + * The interface defining all the services for AgentPools to be + * used by Retrofit to perform actually REST calls. + */ + interface AgentPoolsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Body AgentPoolInner agentPool, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Body AgentPoolInner agentPool, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Body AgentPoolUpdateParameters updateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Body AgentPoolUpdateParameters updateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools getQueueStatus" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus") + Observable> getQueueStatus(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("agentPoolName") String agentPoolName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgentPoolInner object if successful. + */ + public AgentPoolInner get(String resourceGroupName, String registryName, String agentPoolName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName).toBlocking().single().body(); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String agentPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName), serviceCallback); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgentPoolInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String agentPoolName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName).map(new Func1, AgentPoolInner>() { + @Override + public AgentPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgentPoolInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String agentPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgentPoolInner object if successful. + */ + public AgentPoolInner create(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + return createWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, agentPool).toBlocking().last().body(); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, agentPool), serviceCallback); + } + + /** + * 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 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 + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + return createWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, agentPool).map(new Func1, AgentPoolInner>() { + @Override + public AgentPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (agentPool == null) { + throw new IllegalArgumentException("Parameter agentPool is required and cannot be null."); + } + Validator.validate(agentPool); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, this.client.apiVersion(), agentPool, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgentPoolInner object if successful. + */ + public AgentPoolInner beginCreate(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, agentPool).toBlocking().single().body(); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param agentPool The parameters of an agent pool that needs to scheduled. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, agentPool), serviceCallback); + } + + /** + * 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 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 + * @return the observable to the AgentPoolInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, agentPool).map(new Func1, AgentPoolInner>() { + @Override + public AgentPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 + * @return the observable to the AgentPoolInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolInner agentPool) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (agentPool == null) { + throw new IllegalArgumentException("Parameter agentPool is required and cannot be null."); + } + Validator.validate(agentPool); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, this.client.apiVersion(), agentPool, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String agentPoolName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String agentPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String agentPoolName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String agentPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String agentPoolName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String agentPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String agentPoolName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String agentPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgentPoolInner object if successful. + */ + public AgentPoolInner update(String resourceGroupName, String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, updateParameters).toBlocking().last().body(); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, updateParameters), serviceCallback); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, updateParameters).map(new Func1, AgentPoolInner>() { + @Override + public AgentPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, this.client.apiVersion(), updateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgentPoolInner object if successful. + */ + public AgentPoolInner beginUpdate(String resourceGroupName, String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, updateParameters).toBlocking().single().body(); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, updateParameters), serviceCallback); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgentPoolInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName, updateParameters).map(new Func1, AgentPoolInner>() { + @Override + public AgentPoolInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param updateParameters The parameters for updating an agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgentPoolInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String agentPoolName, AgentPoolUpdateParameters updateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, this.client.apiVersion(), updateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AgentPoolInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<AgentPoolInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<AgentPoolInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the agent pools for a specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AgentPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the AgentPoolQueueStatusInner object if successful. + */ + public AgentPoolQueueStatusInner getQueueStatus(String resourceGroupName, String registryName, String agentPoolName) { + return getQueueStatusWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName).toBlocking().single().body(); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getQueueStatusAsync(String resourceGroupName, String registryName, String agentPoolName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getQueueStatusWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName), serviceCallback); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgentPoolQueueStatusInner object + */ + public Observable getQueueStatusAsync(String resourceGroupName, String registryName, String agentPoolName) { + return getQueueStatusWithServiceResponseAsync(resourceGroupName, registryName, agentPoolName).map(new Func1, AgentPoolQueueStatusInner>() { + @Override + public AgentPoolQueueStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 agentPoolName The name of the agent pool. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the AgentPoolQueueStatusInner object + */ + public Observable> getQueueStatusWithServiceResponseAsync(String resourceGroupName, String registryName, String agentPoolName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (agentPoolName == null) { + throw new IllegalArgumentException("Parameter agentPoolName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getQueueStatus(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getQueueStatusDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getQueueStatusDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<AgentPoolInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AgentPoolInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the agent pools for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<AgentPoolInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the agent pools for a specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<AgentPoolInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java index 6fa55f6d9218..0db35ddbfe88 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java @@ -132,6 +132,19 @@ public ContainerRegistryManagementClientImpl withGenerateClientRequestId(boolean return this; } + /** + * The AgentPoolsInner object to access its operations. + */ + private AgentPoolsInner agentPools; + + /** + * Gets the AgentPoolsInner object to access its operations. + * @return the AgentPoolsInner object. + */ + public AgentPoolsInner agentPools() { + return this.agentPools; + } + /** * The RegistriesInner object to access its operations. */ @@ -158,6 +171,19 @@ public RunsInner runs() { return this.runs; } + /** + * The TaskRunsInner object to access its operations. + */ + private TaskRunsInner taskRuns; + + /** + * Gets the TaskRunsInner object to access its operations. + * @return the TaskRunsInner object. + */ + public TaskRunsInner taskRuns() { + return this.taskRuns; + } + /** * The TasksInner object to access its operations. */ @@ -206,8 +232,10 @@ protected void initialize() { this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; + this.agentPools = new AgentPoolsInner(restClient().retrofit(), this); this.registries = new RegistriesInner(restClient().retrofit(), this); this.runs = new RunsInner(restClient().retrofit(), this); + this.taskRuns = new TaskRunsInner(restClient().retrofit(), this); this.tasks = new TasksInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/ContainerRegistryManager.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/ContainerRegistryManager.java index 939e317321f2..91c39f58bb30 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/ContainerRegistryManager.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/ContainerRegistryManager.java @@ -16,8 +16,10 @@ import com.microsoft.azure.arm.resources.AzureConfigurable; import com.microsoft.azure.serializer.AzureJacksonAdapter; import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.AgentPools; import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.Registries; import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.Runs; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns; import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.Tasks; import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; import com.microsoft.azure.arm.resources.implementation.ManagerCore; @@ -26,8 +28,10 @@ * Entry point to Azure ContainerRegistry resource management. */ public final class ContainerRegistryManager extends ManagerCore { + private AgentPools agentPools; private Registries registries; private Runs runs; + private TaskRuns taskRuns; private Tasks tasks; /** * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. @@ -76,6 +80,16 @@ public interface Configurable extends AzureConfigurable { ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId); } + /** + * @return Entry point to manage AgentPools. + */ + public AgentPools agentPools() { + if (this.agentPools == null) { + this.agentPools = new AgentPoolsImpl(this); + } + return this.agentPools; + } + /** * @return Entry point to manage Registries. */ @@ -96,6 +110,16 @@ public Runs runs() { return this.runs; } + /** + * @return Entry point to manage TaskRuns. + */ + public TaskRuns taskRuns() { + if (this.taskRuns == null) { + this.taskRuns = new TaskRunsImpl(this); + } + return this.taskRuns; + } + /** * @return Entry point to manage Tasks. */ diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RegistriesInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RegistriesInner.java index e96c5c7e23e3..8a4b1eb14cab 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RegistriesInner.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RegistriesInner.java @@ -10,7 +10,7 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; -import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ErrorResponseException; import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.RunRequest; import com.microsoft.rest.ServiceCallback; import com.microsoft.rest.ServiceFuture; @@ -75,7 +75,7 @@ interface RegistriesService { * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RunInner object if successful. */ @@ -152,7 +152,7 @@ public Observable> scheduleRunWithServiceResponseAsync * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RunInner object if successful. */ @@ -232,11 +232,11 @@ public Observable> call(Response respons }); } - private ServiceResponse beginScheduleRunDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginScheduleRunDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -246,7 +246,7 @@ private ServiceResponse beginScheduleRunDelegate(Response> call(Response getBuildSourceUploadUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getBuildSourceUploadUrlDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunGetLogResultImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunGetLogResultImpl.java index 80b03766a198..8095a4133052 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunGetLogResultImpl.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunGetLogResultImpl.java @@ -23,6 +23,11 @@ public ContainerRegistryManager manager() { return this.manager; } + @Override + public String logArtifactLink() { + return this.inner().logArtifactLink(); + } + @Override public String logLink() { return this.inner().logLink(); diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunGetLogResultInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunGetLogResultInner.java index 066fa482226f..8c924a253adb 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunGetLogResultInner.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunGetLogResultInner.java @@ -20,6 +20,12 @@ public class RunGetLogResultInner { @JsonProperty(value = "logLink") private String logLink; + /** + * The link to logs in registry for a run on a azure container registry. + */ + @JsonProperty(value = "logArtifactLink") + private String logArtifactLink; + /** * Get the link to logs for a run on a azure container registry. * @@ -40,4 +46,24 @@ public RunGetLogResultInner withLogLink(String logLink) { return this; } + /** + * Get the link to logs in registry for a run on a azure container registry. + * + * @return the logArtifactLink value + */ + public String logArtifactLink() { + return this.logArtifactLink; + } + + /** + * Set the link to logs in registry for a run on a azure container registry. + * + * @param logArtifactLink the logArtifactLink value to set + * @return the RunGetLogResultInner object itself. + */ + public RunGetLogResultInner withLogArtifactLink(String logArtifactLink) { + this.logArtifactLink = logArtifactLink; + return this; + } + } diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunImpl.java index 0d338e1eb88c..c6cae1206946 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunImpl.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunImpl.java @@ -85,6 +85,11 @@ public AgentProperties agentConfiguration() { return this.inner().agentConfiguration(); } + @Override + public String agentPoolName() { + return this.inner().agentPoolName(); + } + @Override public DateTime createTime() { return this.inner().createTime(); @@ -120,6 +125,11 @@ public DateTime lastUpdatedTime() { return this.inner().lastUpdatedTime(); } + @Override + public ImageDescriptor logArtifact() { + return this.inner().logArtifact(); + } + @Override public String name() { return this.inner().name(); diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunInner.java index 03841bf43ab1..701f845ee6ce 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunInner.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunInner.java @@ -55,6 +55,12 @@ public class RunInner extends ProxyResource { @JsonProperty(value = "properties.runType") private RunType runType; + /** + * The dedicated agent pool for the run. + */ + @JsonProperty(value = "properties.agentPoolName") + private String agentPoolName; + /** * The time the run was scheduled. */ @@ -143,6 +149,12 @@ public class RunInner extends ProxyResource { @JsonProperty(value = "properties.updateTriggerToken") private String updateTriggerToken; + /** + * The image description for the log artifact. + */ + @JsonProperty(value = "properties.logArtifact", access = JsonProperty.Access.WRITE_ONLY) + private ImageDescriptor logArtifact; + /** * The provisioning state of a run. Possible values include: 'Creating', * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. @@ -236,6 +248,26 @@ public RunInner withRunType(RunType runType) { return this; } + /** + * Get the dedicated agent pool for the run. + * + * @return the agentPoolName value + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the dedicated agent pool for the run. + * + * @param agentPoolName the agentPoolName value to set + * @return the RunInner object itself. + */ + public RunInner withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + /** * Get the time the run was scheduled. * @@ -505,6 +537,15 @@ public RunInner withUpdateTriggerToken(String updateTriggerToken) { return this; } + /** + * Get the image description for the log artifact. + * + * @return the logArtifact value + */ + public ImageDescriptor logArtifact() { + return this.logArtifact; + } + /** * Get the provisioning state of a run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. * diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunsInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunsInner.java index 971e7de8e320..3fe68b71155e 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunsInner.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/RunsInner.java @@ -11,8 +11,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ErrorResponseException; import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.RunUpdateParameters; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; @@ -101,7 +101,7 @@ interface RunsService { * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<RunInner> object if successful. */ @@ -221,7 +221,7 @@ public Observable>> call(Response r * @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. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<RunInner> object if successful. */ @@ -339,10 +339,10 @@ public Observable>> call(Response r }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -353,7 +353,7 @@ private ServiceResponse> listDelegate(Response * @param registryName The name of the container registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RunInner object if successful. */ @@ -432,10 +432,10 @@ public Observable> call(Response respons }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -446,7 +446,7 @@ private ServiceResponse getDelegate(Response response) t * @param registryName The name of the container registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RunInner object if successful. */ @@ -525,7 +525,7 @@ public Observable> updateWithServiceResponseAsync(Stri * @param runId The run ID. * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RunInner object if successful. */ @@ -606,7 +606,7 @@ public Observable> updateWithServiceResponseAsync(Stri * @param registryName The name of the container registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RunInner object if successful. */ @@ -696,7 +696,7 @@ public Observable> call(Response respons * @param runId The run ID. * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RunInner object if successful. */ @@ -780,11 +780,11 @@ public Observable> call(Response respons }); } - private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -795,7 +795,7 @@ private ServiceResponse beginUpdateDelegate(Response res * @param registryName The name of the container registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the RunGetLogResultInner object if successful. */ @@ -874,10 +874,10 @@ public Observable> call(Response getLogSasUrlDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getLogSasUrlDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -888,7 +888,7 @@ private ServiceResponse getLogSasUrlDelegate(Response> cancelWithServiceResponseAsync(String r * @param registryName The name of the container registry. * @param runId The run ID. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginCancel(String resourceGroupName, String registryName, String runId) { @@ -1041,11 +1041,11 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginCancelDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCancelDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -1054,7 +1054,7 @@ private ServiceResponse beginCancelDelegate(Response respons * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<RunInner> object if successful. */ @@ -1153,10 +1153,10 @@ public Observable>> call(Response r }); } - private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskImpl.java index 57402f0b21ae..a1d9ed9fbcde 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskImpl.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskImpl.java @@ -109,6 +109,11 @@ public AgentProperties agentConfiguration() { return this.inner().agentConfiguration(); } + @Override + public String agentPoolName() { + return this.inner().agentPoolName(); + } + @Override public DateTime creationDate() { return this.inner().creationDate(); @@ -129,11 +134,21 @@ public IdentityProperties identity() { return this.inner().identity(); } + @Override + public Boolean isSystemTask() { + return this.inner().isSystemTask(); + } + @Override public String location() { return this.inner().location(); } + @Override + public String logTemplate() { + return this.inner().logTemplate(); + } + @Override public String name() { return this.inner().name(); @@ -192,6 +207,12 @@ public TaskImpl withLocation(String location) { return this; } + @Override + public TaskImpl withIsSystemTask(Boolean isSystemTask) { + this.inner().withIsSystemTask(isSystemTask); + return this; + } + @Override public TaskImpl withPlatform(PlatformProperties platform) { this.inner().withPlatform(platform); @@ -238,6 +259,16 @@ public TaskImpl withAgentConfiguration(AgentProperties agentConfiguration) { return this; } + @Override + public TaskImpl withAgentPoolName(String agentPoolName) { + if (isInCreateMode()) { + this.inner().withAgentPoolName(agentPoolName); + } else { + this.updateParameter.withAgentPoolName(agentPoolName); + } + return this; + } + @Override public TaskImpl withCredentials(Credentials credentials) { if (isInCreateMode()) { @@ -258,6 +289,16 @@ public TaskImpl withIdentity(IdentityProperties identity) { return this; } + @Override + public TaskImpl withLogTemplate(String logTemplate) { + if (isInCreateMode()) { + this.inner().withLogTemplate(logTemplate); + } else { + this.updateParameter.withLogTemplate(logTemplate); + } + return this; + } + @Override public TaskImpl withStatus(TaskStatus status) { if (isInCreateMode()) { diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskInner.java index c22e049bd7ee..d9a255ab691b 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskInner.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskInner.java @@ -56,7 +56,7 @@ public class TaskInner extends Resource { /** * The platform properties against which the run has to happen. */ - @JsonProperty(value = "properties.platform", required = true) + @JsonProperty(value = "properties.platform") private PlatformProperties platform; /** @@ -65,6 +65,12 @@ public class TaskInner extends Resource { @JsonProperty(value = "properties.agentConfiguration") private AgentProperties agentConfiguration; + /** + * The dedicated agent pool for the task. + */ + @JsonProperty(value = "properties.agentPoolName") + private String agentPoolName; + /** * Run timeout in seconds. */ @@ -74,7 +80,7 @@ public class TaskInner extends Resource { /** * The properties of a task step. */ - @JsonProperty(value = "properties.step", required = true) + @JsonProperty(value = "properties.step") private TaskStepProperties step; /** @@ -90,6 +96,20 @@ public class TaskInner extends Resource { @JsonProperty(value = "properties.credentials") private Credentials credentials; + /** + * The template that describes the repository and tag information for run + * log artifact. + */ + @JsonProperty(value = "properties.logTemplate") + private String logTemplate; + + /** + * The value of this property indicates whether the task resource is system + * task or not. + */ + @JsonProperty(value = "properties.isSystemTask") + private Boolean isSystemTask; + /** * Get identity for the resource. * @@ -188,6 +208,26 @@ public TaskInner withAgentConfiguration(AgentProperties agentConfiguration) { return this; } + /** + * Get the dedicated agent pool for the task. + * + * @return the agentPoolName value + */ + public String agentPoolName() { + return this.agentPoolName; + } + + /** + * Set the dedicated agent pool for the task. + * + * @param agentPoolName the agentPoolName value to set + * @return the TaskInner object itself. + */ + public TaskInner withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + /** * Get run timeout in seconds. * @@ -268,4 +308,44 @@ public TaskInner withCredentials(Credentials credentials) { return this; } + /** + * Get the template that describes the repository and tag information for run log artifact. + * + * @return the logTemplate value + */ + public String logTemplate() { + return this.logTemplate; + } + + /** + * Set the template that describes the repository and tag information for run log artifact. + * + * @param logTemplate the logTemplate value to set + * @return the TaskInner object itself. + */ + public TaskInner withLogTemplate(String logTemplate) { + this.logTemplate = logTemplate; + return this; + } + + /** + * Get the value of this property indicates whether the task resource is system task or not. + * + * @return the isSystemTask value + */ + public Boolean isSystemTask() { + return this.isSystemTask; + } + + /** + * Set the value of this property indicates whether the task resource is system task or not. + * + * @param isSystemTask the isSystemTask value to set + * @return the TaskInner object itself. + */ + public TaskInner withIsSystemTask(Boolean isSystemTask) { + this.isSystemTask = isSystemTask; + return this; + } + } diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunImpl.java new file mode 100644 index 000000000000..1e0edb67f1d4 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunImpl.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRun; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRunUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.IdentityProperties; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.RunRequest; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.Run; +import rx.functions.Func1; + +class TaskRunImpl extends CreatableUpdatableImpl implements TaskRun, TaskRun.Definition, TaskRun.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String taskRunName; + private TaskRunUpdateParameters updateParameter; + + TaskRunImpl(String name, ContainerRegistryManager manager) { + super(name, new TaskRunInner()); + this.manager = manager; + // Set resource name + this.taskRunName = name; + // + this.updateParameter = new TaskRunUpdateParameters(); + } + + TaskRunImpl(TaskRunInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.taskRunName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.taskRunName = IdParsingUtils.getValueFromIdByName(inner.id(), "taskRuns"); + // + this.updateParameter = new TaskRunUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TaskRunsInner client = this.manager().inner().taskRuns(); + return client.createAsync(this.resourceGroupName, this.registryName, this.taskRunName, this.inner()) + .map(new Func1() { + @Override + public TaskRunInner call(TaskRunInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TaskRunsInner client = this.manager().inner().taskRuns(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.taskRunName, this.updateParameter) + .map(new Func1() { + @Override + public TaskRunInner call(TaskRunInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TaskRunsInner client = this.manager().inner().taskRuns(); + return client.getAsync(this.resourceGroupName, this.registryName, this.taskRunName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new TaskRunUpdateParameters(); + } + + @Override + public String forceUpdateTag() { + return this.inner().forceUpdateTag(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public IdentityProperties identity() { + return this.inner().identity(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public RunRequest runRequest() { + return this.inner().runRequest(); + } + + @Override + public Run runResult() { + RunInner inner = this.inner().runResult(); + if (inner != null) { + return new RunImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TaskRunImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public TaskRunImpl withTags(Map tags) { + this.updateParameter.withTags(tags); + return this; + } + + @Override + public TaskRunImpl withForceUpdateTag(String forceUpdateTag) { + if (isInCreateMode()) { + this.inner().withForceUpdateTag(forceUpdateTag); + } else { + this.updateParameter.withForceUpdateTag(forceUpdateTag); + } + return this; + } + + @Override + public TaskRunImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + + @Override + public TaskRunImpl withLocation(String location) { + if (isInCreateMode()) { + this.inner().withLocation(location); + } else { + this.updateParameter.withLocation(location); + } + return this; + } + + @Override + public TaskRunImpl withRunRequest(RunRequest runRequest) { + if (isInCreateMode()) { + this.inner().withRunRequest(runRequest); + } else { + this.updateParameter.withRunRequest(runRequest); + } + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunInner.java new file mode 100644 index 000000000000..0ad07b65a4d7 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunInner.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.IdentityProperties; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.RunRequest; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * The task run that has the ARM resource and properties. + * The task run will have the information of request and result of a run. + */ +@JsonFlatten +public class TaskRunInner extends ProxyResource { + /** + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** + * The provisioning state of this task run. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The request (parameters) for the run. + */ + @JsonProperty(value = "properties.runRequest") + private RunRequest runRequest; + + /** + * The result of this task run. + */ + @JsonProperty(value = "properties.runResult", access = JsonProperty.Access.WRITE_ONLY) + private RunInner runResult; + + /** + * How the run should be forced to rerun even if the run request + * configuration has not changed. + */ + @JsonProperty(value = "properties.forceUpdateTag") + private String forceUpdateTag; + + /** + * The location of the resource. + */ + @JsonProperty(value = "location") + private String location; + + /** + * Get identity for the resource. + * + * @return the identity value + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set identity for the resource. + * + * @param identity the identity value to set + * @return the TaskRunInner object itself. + */ + public TaskRunInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioning state of this task run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the request (parameters) for the run. + * + * @return the runRequest value + */ + public RunRequest runRequest() { + return this.runRequest; + } + + /** + * Set the request (parameters) for the run. + * + * @param runRequest the runRequest value to set + * @return the TaskRunInner object itself. + */ + public TaskRunInner withRunRequest(RunRequest runRequest) { + this.runRequest = runRequest; + return this; + } + + /** + * Get the result of this task run. + * + * @return the runResult value + */ + public RunInner runResult() { + return this.runResult; + } + + /** + * Get how the run should be forced to rerun even if the run request configuration has not changed. + * + * @return the forceUpdateTag value + */ + public String forceUpdateTag() { + return this.forceUpdateTag; + } + + /** + * Set how the run should be forced to rerun even if the run request configuration has not changed. + * + * @param forceUpdateTag the forceUpdateTag value to set + * @return the TaskRunInner object itself. + */ + public TaskRunInner withForceUpdateTag(String forceUpdateTag) { + this.forceUpdateTag = forceUpdateTag; + return this; + } + + /** + * Get the location of the resource. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the resource. + * + * @param location the location value to set + * @return the TaskRunInner object itself. + */ + public TaskRunInner withLocation(String location) { + this.location = location; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunsImpl.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunsImpl.java new file mode 100644 index 000000000000..8ee4895cbbe1 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunsImpl.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRun; + +class TaskRunsImpl extends WrapperImpl implements TaskRuns { + private final ContainerRegistryManager manager; + + TaskRunsImpl(ContainerRegistryManager manager) { + super(manager.inner().taskRuns()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public TaskRunImpl define(String name) { + return wrapModel(name); + } + + private TaskRunImpl wrapModel(TaskRunInner inner) { + return new TaskRunImpl(inner, manager()); + } + + private TaskRunImpl wrapModel(String name) { + return new TaskRunImpl(name, this.manager()); + } + + @Override + public Observable getDetailsAsync(String resourceGroupName, String registryName, String taskRunName) { + TaskRunsInner client = this.inner(); + return client.getDetailsAsync(resourceGroupName, registryName, taskRunName) + .map(new Func1() { + @Override + public TaskRun call(TaskRunInner inner) { + return new TaskRunImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + TaskRunsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public TaskRun call(TaskRunInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String taskRunName) { + TaskRunsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, taskRunName) + .flatMap(new Func1>() { + @Override + public Observable call(TaskRunInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((TaskRun)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String taskRunName) { + TaskRunsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, taskRunName).toCompletable(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunsInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunsInner.java new file mode 100644 index 000000000000..098b8522f5e8 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TaskRunsInner.java @@ -0,0 +1,1070 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2019_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ErrorResponseException; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRunUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in TaskRuns. + */ +public class TaskRunsInner { + /** The Retrofit service to perform REST calls. */ + private TaskRunsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of TaskRunsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TaskRunsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(TaskRunsService.class); + this.client = client; + } + + /** + * The interface defining all the services for TaskRuns to be + * used by Retrofit to perform actually REST calls. + */ + interface TaskRunsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskRunName") String taskRunName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskRunName") String taskRunName, @Query("api-version") String apiVersion, @Body TaskRunInner taskRun, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskRunName") String taskRunName, @Query("api-version") String apiVersion, @Body TaskRunInner taskRun, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskRunName") String taskRunName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskRunName") String taskRunName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskRunName") String taskRunName, @Query("api-version") String apiVersion, @Body TaskRunUpdateParameters updateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskRunName") String taskRunName, @Query("api-version") String apiVersion, @Body TaskRunUpdateParameters updateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns getDetails" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}/listDetails") + Observable> getDetails(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskRunName") String taskRunName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskRuns listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * 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 taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskRunInner object if successful. + */ + public TaskRunInner get(String resourceGroupName, String registryName, String taskRunName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, taskRunName).toBlocking().single().body(); + } + + /** + * 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 taskRunName The name of the task run. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String taskRunName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, taskRunName), serviceCallback); + } + + /** + * 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 taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskRunInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String taskRunName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, taskRunName).map(new Func1, TaskRunInner>() { + @Override + public TaskRunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskRunInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String taskRunName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskRunName == null) { + throw new IllegalArgumentException("Parameter taskRunName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskRunInner object if successful. + */ + public TaskRunInner create(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + return createWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, taskRun).toBlocking().last().body(); + } + + /** + * 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 taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, taskRun), serviceCallback); + } + + /** + * 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 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 + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + return createWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, taskRun).map(new Func1, TaskRunInner>() { + @Override + public TaskRunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskRunName == null) { + throw new IllegalArgumentException("Parameter taskRunName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (taskRun == null) { + throw new IllegalArgumentException("Parameter taskRun is required and cannot be null."); + } + Validator.validate(taskRun); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, this.client.apiVersion(), taskRun, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskRunInner object if successful. + */ + public TaskRunInner beginCreate(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, taskRun).toBlocking().single().body(); + } + + /** + * 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 taskRunName The name of the task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, taskRun), serviceCallback); + } + + /** + * 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 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 + * @return the observable to the TaskRunInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, taskRun).map(new Func1, TaskRunInner>() { + @Override + public TaskRunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 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 + * @return the observable to the TaskRunInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunInner taskRun) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskRunName == null) { + throw new IllegalArgumentException("Parameter taskRunName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (taskRun == null) { + throw new IllegalArgumentException("Parameter taskRun is required and cannot be null."); + } + Validator.validate(taskRun); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, this.client.apiVersion(), taskRun, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String taskRunName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, taskRunName).toBlocking().last().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String taskRunName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, taskRunName), serviceCallback); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String taskRunName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, taskRunName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String taskRunName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskRunName == null) { + throw new IllegalArgumentException("Parameter taskRunName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String taskRunName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskRunName).toBlocking().single().body(); + } + + /** + * 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 serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String taskRunName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskRunName), serviceCallback); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String taskRunName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskRunName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String taskRunName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskRunName == null) { + throw new IllegalArgumentException("Parameter taskRunName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskRunInner object if successful. + */ + public TaskRunInner update(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, updateParameters).toBlocking().last().body(); + } + + /** + * 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 taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, updateParameters), serviceCallback); + } + + /** + * 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 taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, updateParameters).map(new Func1, TaskRunInner>() { + @Override + public TaskRunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskRunName == null) { + throw new IllegalArgumentException("Parameter taskRunName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, this.client.apiVersion(), updateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * 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 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskRunInner object if successful. + */ + public TaskRunInner beginUpdate(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, updateParameters).toBlocking().single().body(); + } + + /** + * 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 taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, updateParameters), serviceCallback); + } + + /** + * 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 taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskRunInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskRunName, updateParameters).map(new Func1, TaskRunInner>() { + @Override + public TaskRunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 taskRunName The name of the task run. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskRunInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskRunName, TaskRunUpdateParameters updateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskRunName == null) { + throw new IllegalArgumentException("Parameter taskRunName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, this.client.apiVersion(), updateParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TaskRunInner object if successful. + */ + public TaskRunInner getDetails(String resourceGroupName, String registryName, String taskRunName) { + return getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskRunName).toBlocking().single().body(); + } + + /** + * 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 taskRunName The name of the task run. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getDetailsAsync(String resourceGroupName, String registryName, String taskRunName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskRunName), serviceCallback); + } + + /** + * 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 taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskRunInner object + */ + public Observable getDetailsAsync(String resourceGroupName, String registryName, String taskRunName) { + return getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskRunName).map(new Func1, TaskRunInner>() { + @Override + public TaskRunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * 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 taskRunName The name of the task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskRunInner object + */ + public Observable> getDetailsWithServiceResponseAsync(String resourceGroupName, String registryName, String taskRunName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (taskRunName == null) { + throw new IllegalArgumentException("Parameter taskRunName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getDetails(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getDetailsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDetailsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * 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 ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TaskRunInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * 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. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * 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 + * @return the observable to the PagedList<TaskRunInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * 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 + * @return the observable to the PagedList<TaskRunInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the task runs for a specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TaskRunInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TaskRunInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TaskRunInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the task runs for a specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TaskRunInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the task runs for a specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<TaskRunInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TasksInner.java b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TasksInner.java index 7370527c74f9..8a4dc271502a 100644 --- a/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TasksInner.java +++ b/sdk/containerregistry/mgmt-v2019_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_06_01_preview/implementation/TasksInner.java @@ -11,8 +11,8 @@ import retrofit2.Retrofit; import com.google.common.reflect.TypeToken; import com.microsoft.azure.AzureServiceFuture; -import com.microsoft.azure.CloudException; import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.ErrorResponseException; import com.microsoft.azure.management.containerregistry.v2019_06_01_preview.TaskUpdateParameters; import com.microsoft.azure.Page; import com.microsoft.azure.PagedList; @@ -112,7 +112,7 @@ interface TasksService { * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<TaskInner> object if successful. */ @@ -222,10 +222,10 @@ public Observable>> call(Response }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -236,7 +236,7 @@ private ServiceResponse> listDelegate(Response * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TaskInner object if successful. */ @@ -315,10 +315,10 @@ public Observable> call(Response respon }); } - private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -330,7 +330,7 @@ private ServiceResponse getDelegate(Response response) * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TaskInner object if successful. */ @@ -414,7 +414,7 @@ public Observable> createWithServiceResponseAsync(Str * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TaskInner object if successful. */ @@ -500,11 +500,11 @@ public Observable> call(Response respon }); } - private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginCreateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -515,7 +515,7 @@ private ServiceResponse beginCreateDelegate(Response re * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void delete(String resourceGroupName, String registryName, String taskName) { @@ -590,7 +590,7 @@ public Observable> deleteWithServiceResponseAsync(String r * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void beginDelete(String resourceGroupName, String registryName, String taskName) { @@ -668,12 +668,12 @@ public Observable> call(Response response) { }); } - private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginDeleteDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(202, new TypeToken() { }.getType()) .register(204, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -685,7 +685,7 @@ private ServiceResponse beginDeleteDelegate(Response respons * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TaskInner object if successful. */ @@ -769,7 +769,7 @@ public Observable> updateWithServiceResponseAsync(Str * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TaskInner object if successful. */ @@ -855,11 +855,11 @@ public Observable> call(Response respon }); } - private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse beginUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) .register(201, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -870,7 +870,7 @@ private ServiceResponse beginUpdateDelegate(Response re * @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 CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the TaskInner object if successful. */ @@ -949,10 +949,10 @@ public Observable> call(Response respon }); } - private ServiceResponse getDetailsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + private ServiceResponse getDetailsDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); } @@ -961,7 +961,7 @@ private ServiceResponse getDetailsDelegate(Response res * * @param nextPageLink The NextLink from the previous successful call to List operation. * @throws IllegalArgumentException thrown if parameters fail the validation - * @throws CloudException thrown if the request is rejected by server + * @throws ErrorResponseException thrown if the request is rejected by server * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the PagedList<TaskInner> object if successful. */ @@ -1060,10 +1060,10 @@ public Observable>> call(Response }); } - private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + private ServiceResponse> listNextDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) .register(200, new TypeToken>() { }.getType()) - .registerError(CloudException.class) + .registerError(ErrorResponseException.class) .build(response); }