diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/pom.xml b/sdk/containerregistry/mgmt-v2019_12_01_preview/pom.xml new file mode 100644 index 000000000000..f7c7222c6944 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + com.microsoft.azure.containerregistry.v2019_12_01_preview + + com.microsoft.azure + azure-arm-parent + 1.1.0 + ../../../pom.management.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-sdk-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + 1.6.5 + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Action.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Action.java new file mode 100644 index 000000000000..7cbbf7bdb9b2 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Action.java @@ -0,0 +1,38 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Action. + */ +public final class Action extends ExpandableStringEnum { + /** Static value Allow for Action. */ + public static final Action ALLOW = fromString("Allow"); + + /** + * Creates or finds a Action from its string representation. + * @param name a name to look for + * @return the corresponding Action + */ + @JsonCreator + public static Action fromString(String name) { + return fromString(name, Action.class); + } + + /** + * @return known Action values + */ + public static Collection values() { + return values(Action.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ActionsRequired.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ActionsRequired.java new file mode 100644 index 000000000000..79b57407e4bf --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ActionsRequired.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ActionsRequired. + */ +public final class ActionsRequired extends ExpandableStringEnum { + /** Static value None for ActionsRequired. */ + public static final ActionsRequired NONE = fromString("None"); + + /** Static value Recreate for ActionsRequired. */ + public static final ActionsRequired RECREATE = fromString("Recreate"); + + /** + * Creates or finds a ActionsRequired from its string representation. + * @param name a name to look for + * @return the corresponding ActionsRequired + */ + @JsonCreator + public static ActionsRequired fromString(String name) { + return fromString(name, ActionsRequired.class); + } + + /** + * @return known ActionsRequired values + */ + public static Collection values() { + return values(ActionsRequired.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ActiveDirectoryObject.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ActiveDirectoryObject.java new file mode 100644 index 000000000000..05c7cb6c67df --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ActiveDirectoryObject.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Active Directory Object that will be used for authenticating the token + * of a container registry. + */ +public class ActiveDirectoryObject { + /** + * The user/group/application object ID for Active Directory Object that + * will be used for authenticating the token of a container registry. + */ + @JsonProperty(value = "objectId") + private String objectId; + + /** + * The tenant ID of user/group/application object Active Directory Object + * that will be used for authenticating the token of a container registry. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * Get the user/group/application object ID for Active Directory Object that will be used for authenticating the token of a container registry. + * + * @return the objectId value + */ + public String objectId() { + return this.objectId; + } + + /** + * Set the user/group/application object ID for Active Directory Object that will be used for authenticating the token of a container registry. + * + * @param objectId the objectId value to set + * @return the ActiveDirectoryObject object itself. + */ + public ActiveDirectoryObject withObjectId(String objectId) { + this.objectId = objectId; + return this; + } + + /** + * Get the tenant ID of user/group/application object Active Directory Object that will be used for authenticating the token of a container registry. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenant ID of user/group/application object Active Directory Object that will be used for authenticating the token of a container registry. + * + * @param tenantId the tenantId value to set + * @return the ActiveDirectoryObject object itself. + */ + public ActiveDirectoryObject withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Actor.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Actor.java new file mode 100644 index 000000000000..fdf862ad5c66 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Actor.java @@ -0,0 +1,45 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The agent that initiated the event. For most situations, this could be from + * the authorization context of the request. + */ +public class Actor { + /** + * The subject or username associated with the request context that + * generated the event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the subject or username associated with the request context that generated the event. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the subject or username associated with the request context that generated the event. + * + * @param name the name value to set + * @return the Actor object itself. + */ + public Actor withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentPool.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentPool.java new file mode 100644 index 000000000000..db287c5cda28 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentPoolQueueStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentPoolQueueStatus.java new file mode 100644 index 000000000000..c4f8f9ed80cc --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentPoolUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentPoolUpdateParameters.java new file mode 100644 index 000000000000..7673f4bcaa21 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentPools.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentPools.java new file mode 100644 index 000000000000..1aa6e1851542 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentProperties.java new file mode 100644 index 000000000000..fd11809fe87e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AgentProperties.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties that determine the run agent configuration. + */ +public class AgentProperties { + /** + * The CPU configuration in terms of number of cores required for the run. + */ + @JsonProperty(value = "cpu") + private Integer cpu; + + /** + * Get the CPU configuration in terms of number of cores required for the run. + * + * @return the cpu value + */ + public Integer cpu() { + return this.cpu; + } + + /** + * Set the CPU configuration in terms of number of cores required for the run. + * + * @param cpu the cpu value to set + * @return the AgentProperties object itself. + */ + public AgentProperties withCpu(Integer cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Architecture.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Architecture.java new file mode 100644 index 000000000000..aca5871940a3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Architecture.java @@ -0,0 +1,50 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Architecture. + */ +public final class Architecture extends ExpandableStringEnum { + /** Static value amd64 for Architecture. */ + public static final Architecture AMD64 = fromString("amd64"); + + /** Static value x86 for Architecture. */ + public static final Architecture X86 = fromString("x86"); + + /** Static value 386 for Architecture. */ + public static final Architecture THREE_EIGHT_SIX = fromString("386"); + + /** Static value arm for Architecture. */ + public static final Architecture ARM = fromString("arm"); + + /** Static value arm64 for Architecture. */ + public static final Architecture ARM64 = fromString("arm64"); + + /** + * Creates or finds a Architecture from its string representation. + * @param name a name to look for + * @return the corresponding Architecture + */ + @JsonCreator + public static Architecture fromString(String name) { + return fromString(name, Architecture.class); + } + + /** + * @return known Architecture values + */ + public static Collection values() { + return values(Architecture.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Argument.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Argument.java new file mode 100644 index 000000000000..71e5e45aa705 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Argument.java @@ -0,0 +1,96 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a run argument. + */ +public class Argument { + /** + * The name of the argument. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The value of the argument. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Flag to indicate whether the argument represents a secret and want to be + * removed from build logs. + */ + @JsonProperty(value = "isSecret") + private Boolean isSecret; + + /** + * Get the name of the argument. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the argument. + * + * @param name the name value to set + * @return the Argument object itself. + */ + public Argument withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the argument. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the argument. + * + * @param value the value value to set + * @return the Argument object itself. + */ + public Argument withValue(String value) { + this.value = value; + return this; + } + + /** + * Get flag to indicate whether the argument represents a secret and want to be removed from build logs. + * + * @return the isSecret value + */ + public Boolean isSecret() { + return this.isSecret; + } + + /** + * Set flag to indicate whether the argument represents a secret and want to be removed from build logs. + * + * @param isSecret the isSecret value to set + * @return the Argument object itself. + */ + public Argument withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AuthInfo.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AuthInfo.java new file mode 100644 index 000000000000..82ead3447738 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AuthInfo.java @@ -0,0 +1,147 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The authorization properties for accessing the source code repository. + */ +public class AuthInfo { + /** + * The type of Auth token. Possible values include: 'PAT', 'OAuth'. + */ + @JsonProperty(value = "tokenType", required = true) + private TokenType tokenType; + + /** + * The access token used to access the source control provider. + */ + @JsonProperty(value = "token", required = true) + private String token; + + /** + * The refresh token used to refresh the access token. + */ + @JsonProperty(value = "refreshToken") + private String refreshToken; + + /** + * The scope of the access token. + */ + @JsonProperty(value = "scope") + private String scope; + + /** + * Time in seconds that the token remains valid. + */ + @JsonProperty(value = "expiresIn") + private Integer expiresIn; + + /** + * Get the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @return the tokenType value + */ + public TokenType tokenType() { + return this.tokenType; + } + + /** + * Set the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @param tokenType the tokenType value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withTokenType(TokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get the access token used to access the source control provider. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set the access token used to access the source control provider. + * + * @param token the token value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the refresh token used to refresh the access token. + * + * @return the refreshToken value + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refresh token used to refresh the access token. + * + * @param refreshToken the refreshToken value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the scope of the access token. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of the access token. + * + * @param scope the scope value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get time in seconds that the token remains valid. + * + * @return the expiresIn value + */ + public Integer expiresIn() { + return this.expiresIn; + } + + /** + * Set time in seconds that the token remains valid. + * + * @param expiresIn the expiresIn value to set + * @return the AuthInfo object itself. + */ + public AuthInfo withExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AuthInfoUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AuthInfoUpdateParameters.java new file mode 100644 index 000000000000..3afd20f71f9a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/AuthInfoUpdateParameters.java @@ -0,0 +1,147 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The authorization properties for accessing the source code repository. + */ +public class AuthInfoUpdateParameters { + /** + * The type of Auth token. Possible values include: 'PAT', 'OAuth'. + */ + @JsonProperty(value = "tokenType") + private TokenType tokenType; + + /** + * The access token used to access the source control provider. + */ + @JsonProperty(value = "token") + private String token; + + /** + * The refresh token used to refresh the access token. + */ + @JsonProperty(value = "refreshToken") + private String refreshToken; + + /** + * The scope of the access token. + */ + @JsonProperty(value = "scope") + private String scope; + + /** + * Time in seconds that the token remains valid. + */ + @JsonProperty(value = "expiresIn") + private Integer expiresIn; + + /** + * Get the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @return the tokenType value + */ + public TokenType tokenType() { + return this.tokenType; + } + + /** + * Set the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @param tokenType the tokenType value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withTokenType(TokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get the access token used to access the source control provider. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set the access token used to access the source control provider. + * + * @param token the token value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the refresh token used to refresh the access token. + * + * @return the refreshToken value + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refresh token used to refresh the access token. + * + * @param refreshToken the refreshToken value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the scope of the access token. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of the access token. + * + * @param scope the scope value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get time in seconds that the token remains valid. + * + * @return the expiresIn value + */ + public Integer expiresIn() { + return this.expiresIn; + } + + /** + * Set time in seconds that the token remains valid. + * + * @param expiresIn the expiresIn value to set + * @return the AuthInfoUpdateParameters object itself. + */ + public AuthInfoUpdateParameters withExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageDependency.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageDependency.java new file mode 100644 index 000000000000..097fbb749f75 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageDependency.java @@ -0,0 +1,148 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that describe a base image dependency. + */ +public class BaseImageDependency { + /** + * The type of the base image dependency. Possible values include: + * 'BuildTime', 'RunTime'. + */ + @JsonProperty(value = "type") + private BaseImageDependencyType type; + + /** + * The registry login server. + */ + @JsonProperty(value = "registry") + private String registry; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * The sha256-based digest of the image manifest. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * Get the type of the base image dependency. Possible values include: 'BuildTime', 'RunTime'. + * + * @return the type value + */ + public BaseImageDependencyType type() { + return this.type; + } + + /** + * Set the type of the base image dependency. Possible values include: 'BuildTime', 'RunTime'. + * + * @param type the type value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withType(BaseImageDependencyType type) { + this.type = type; + return this; + } + + /** + * Get the registry login server. + * + * @return the registry value + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry login server. + * + * @param registry the registry value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withRegistry(String registry) { + this.registry = registry; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the sha256-based digest of the image manifest. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the sha256-based digest of the image manifest. + * + * @param digest the digest value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withDigest(String digest) { + this.digest = digest; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageDependencyType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageDependencyType.java new file mode 100644 index 000000000000..82fae7378f67 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageDependencyType.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BaseImageDependencyType. + */ +public final class BaseImageDependencyType extends ExpandableStringEnum { + /** Static value BuildTime for BaseImageDependencyType. */ + public static final BaseImageDependencyType BUILD_TIME = fromString("BuildTime"); + + /** Static value RunTime for BaseImageDependencyType. */ + public static final BaseImageDependencyType RUN_TIME = fromString("RunTime"); + + /** + * Creates or finds a BaseImageDependencyType from its string representation. + * @param name a name to look for + * @return the corresponding BaseImageDependencyType + */ + @JsonCreator + public static BaseImageDependencyType fromString(String name) { + return fromString(name, BaseImageDependencyType.class); + } + + /** + * @return known BaseImageDependencyType values + */ + public static Collection values() { + return values(BaseImageDependencyType.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTrigger.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTrigger.java new file mode 100644 index 000000000000..0f681c70bffd --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTrigger.java @@ -0,0 +1,150 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The trigger based on base image dependency. + */ +public class BaseImageTrigger { + /** + * The type of the auto trigger for base image dependency updates. Possible + * values include: 'All', 'Runtime'. + */ + @JsonProperty(value = "baseImageTriggerType", required = true) + private BaseImageTriggerType baseImageTriggerType; + + /** + * The endpoint URL for receiving update triggers. + */ + @JsonProperty(value = "updateTriggerEndpoint") + private String updateTriggerEndpoint; + + /** + * Type of Payload body for Base image update triggers. Possible values + * include: 'Default', 'Token'. + */ + @JsonProperty(value = "updateTriggerPayloadType") + private UpdateTriggerPayloadType updateTriggerPayloadType; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'. + * + * @return the baseImageTriggerType value + */ + public BaseImageTriggerType baseImageTriggerType() { + return this.baseImageTriggerType; + } + + /** + * Set the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'. + * + * @param baseImageTriggerType the baseImageTriggerType value to set + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withBaseImageTriggerType(BaseImageTriggerType baseImageTriggerType) { + this.baseImageTriggerType = baseImageTriggerType; + return this; + } + + /** + * Get the endpoint URL for receiving update triggers. + * + * @return the updateTriggerEndpoint value + */ + public String updateTriggerEndpoint() { + return this.updateTriggerEndpoint; + } + + /** + * Set the endpoint URL for receiving update triggers. + * + * @param updateTriggerEndpoint the updateTriggerEndpoint value to set + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withUpdateTriggerEndpoint(String updateTriggerEndpoint) { + this.updateTriggerEndpoint = updateTriggerEndpoint; + return this; + } + + /** + * Get type of Payload body for Base image update triggers. Possible values include: 'Default', 'Token'. + * + * @return the updateTriggerPayloadType value + */ + public UpdateTriggerPayloadType updateTriggerPayloadType() { + return this.updateTriggerPayloadType; + } + + /** + * Set type of Payload body for Base image update triggers. Possible values include: 'Default', 'Token'. + * + * @param updateTriggerPayloadType the updateTriggerPayloadType value to set + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withUpdateTriggerPayloadType(UpdateTriggerPayloadType updateTriggerPayloadType) { + this.updateTriggerPayloadType = updateTriggerPayloadType; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the BaseImageTrigger object itself. + */ + public BaseImageTrigger withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTriggerType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTriggerType.java new file mode 100644 index 000000000000..337d6b50a86c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTriggerType.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BaseImageTriggerType. + */ +public final class BaseImageTriggerType extends ExpandableStringEnum { + /** Static value All for BaseImageTriggerType. */ + public static final BaseImageTriggerType ALL = fromString("All"); + + /** Static value Runtime for BaseImageTriggerType. */ + public static final BaseImageTriggerType RUNTIME = fromString("Runtime"); + + /** + * Creates or finds a BaseImageTriggerType from its string representation. + * @param name a name to look for + * @return the corresponding BaseImageTriggerType + */ + @JsonCreator + public static BaseImageTriggerType fromString(String name) { + return fromString(name, BaseImageTriggerType.class); + } + + /** + * @return known BaseImageTriggerType values + */ + public static Collection values() { + return values(BaseImageTriggerType.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTriggerUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTriggerUpdateParameters.java new file mode 100644 index 000000000000..c59e39a0b39b --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/BaseImageTriggerUpdateParameters.java @@ -0,0 +1,150 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating base image dependency trigger. + */ +public class BaseImageTriggerUpdateParameters { + /** + * The type of the auto trigger for base image dependency updates. Possible + * values include: 'All', 'Runtime'. + */ + @JsonProperty(value = "baseImageTriggerType") + private BaseImageTriggerType baseImageTriggerType; + + /** + * The endpoint URL for receiving update triggers. + */ + @JsonProperty(value = "updateTriggerEndpoint") + private String updateTriggerEndpoint; + + /** + * Type of Payload body for Base image update triggers. Possible values + * include: 'Default', 'Token'. + */ + @JsonProperty(value = "updateTriggerPayloadType") + private UpdateTriggerPayloadType updateTriggerPayloadType; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'. + * + * @return the baseImageTriggerType value + */ + public BaseImageTriggerType baseImageTriggerType() { + return this.baseImageTriggerType; + } + + /** + * Set the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime'. + * + * @param baseImageTriggerType the baseImageTriggerType value to set + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withBaseImageTriggerType(BaseImageTriggerType baseImageTriggerType) { + this.baseImageTriggerType = baseImageTriggerType; + return this; + } + + /** + * Get the endpoint URL for receiving update triggers. + * + * @return the updateTriggerEndpoint value + */ + public String updateTriggerEndpoint() { + return this.updateTriggerEndpoint; + } + + /** + * Set the endpoint URL for receiving update triggers. + * + * @param updateTriggerEndpoint the updateTriggerEndpoint value to set + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withUpdateTriggerEndpoint(String updateTriggerEndpoint) { + this.updateTriggerEndpoint = updateTriggerEndpoint; + return this; + } + + /** + * Get type of Payload body for Base image update triggers. Possible values include: 'Default', 'Token'. + * + * @return the updateTriggerPayloadType value + */ + public UpdateTriggerPayloadType updateTriggerPayloadType() { + return this.updateTriggerPayloadType; + } + + /** + * Set type of Payload body for Base image update triggers. Possible values include: 'Default', 'Token'. + * + * @param updateTriggerPayloadType the updateTriggerPayloadType value to set + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withUpdateTriggerPayloadType(UpdateTriggerPayloadType updateTriggerPayloadType) { + this.updateTriggerPayloadType = updateTriggerPayloadType; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the BaseImageTriggerUpdateParameters object itself. + */ + public BaseImageTriggerUpdateParameters withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/CallbackConfig.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/CallbackConfig.java new file mode 100644 index 000000000000..c78059093075 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/CallbackConfig.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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.CallbackConfigInner; +import java.util.Map; + +/** + * Type representing CallbackConfig. + */ +public interface CallbackConfig extends HasInner, HasManager { + /** + * @return the customHeaders value. + */ + Map customHeaders(); + + /** + * @return the serviceUri value. + */ + String serviceUri(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Credentials.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Credentials.java new file mode 100644 index 000000000000..1b84813914d6 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Credentials.java @@ -0,0 +1,80 @@ +/** + * 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_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters that describes a set of credentials that will be used when a + * run is invoked. + */ +public class Credentials { + /** + * Describes the credential parameters for accessing the source registry. + */ + @JsonProperty(value = "sourceRegistry") + private SourceRegistryCredentials sourceRegistry; + + /** + * Describes the credential parameters for accessing other custom + * registries. The key + * for the dictionary item will be the registry login server + * (myregistry.azurecr.io) and + * the value of the item will be the registry credentials for accessing the + * registry. + */ + @JsonProperty(value = "customRegistries") + private Map customRegistries; + + /** + * Get describes the credential parameters for accessing the source registry. + * + * @return the sourceRegistry value + */ + public SourceRegistryCredentials sourceRegistry() { + return this.sourceRegistry; + } + + /** + * Set describes the credential parameters for accessing the source registry. + * + * @param sourceRegistry the sourceRegistry value to set + * @return the Credentials object itself. + */ + public Credentials withSourceRegistry(SourceRegistryCredentials sourceRegistry) { + this.sourceRegistry = sourceRegistry; + return this; + } + + /** + * Get describes the credential parameters for accessing other custom registries. The key + for the dictionary item will be the registry login server (myregistry.azurecr.io) and + the value of the item will be the registry credentials for accessing the registry. + * + * @return the customRegistries value + */ + public Map customRegistries() { + return this.customRegistries; + } + + /** + * Set describes the credential parameters for accessing other custom registries. The key + for the dictionary item will be the registry login server (myregistry.azurecr.io) and + the value of the item will be the registry credentials for accessing the registry. + * + * @param customRegistries the customRegistries value to set + * @return the Credentials object itself. + */ + public Credentials withCustomRegistries(Map customRegistries) { + this.customRegistries = customRegistries; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/CustomRegistryCredentials.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/CustomRegistryCredentials.java new file mode 100644 index 000000000000..4ccdb6a3210e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/CustomRegistryCredentials.java @@ -0,0 +1,116 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the credentials that will be used to access a custom registry + * during a run. + */ +public class CustomRegistryCredentials { + /** + * The username for logging into the custom registry. + */ + @JsonProperty(value = "userName") + private SecretObject userName; + + /** + * The password for logging into the custom registry. The password is a + * secret + * object that allows multiple ways of providing the value for it. + */ + @JsonProperty(value = "password") + private SecretObject password; + + /** + * Indicates the managed identity assigned to the custom credential. If a + * user-assigned identity + * this value is the Client ID. If a system-assigned identity, the value + * will be `system`. In + * the case of a system-assigned identity, the Client ID will be determined + * by the runner. This + * identity may be used to authenticate to key vault to retrieve + * credentials or it may be the only + * source of authentication used for accessing the registry. + */ + @JsonProperty(value = "identity") + private String identity; + + /** + * Get the username for logging into the custom registry. + * + * @return the userName value + */ + public SecretObject userName() { + return this.userName; + } + + /** + * Set the username for logging into the custom registry. + * + * @param userName the userName value to set + * @return the CustomRegistryCredentials object itself. + */ + public CustomRegistryCredentials withUserName(SecretObject userName) { + this.userName = userName; + return this; + } + + /** + * Get the password for logging into the custom registry. The password is a secret + object that allows multiple ways of providing the value for it. + * + * @return the password value + */ + public SecretObject password() { + return this.password; + } + + /** + * Set the password for logging into the custom registry. The password is a secret + object that allows multiple ways of providing the value for it. + * + * @param password the password value to set + * @return the CustomRegistryCredentials object itself. + */ + public CustomRegistryCredentials withPassword(SecretObject password) { + this.password = password; + return this; + } + + /** + * Get indicates the managed identity assigned to the custom credential. If a user-assigned identity + this value is the Client ID. If a system-assigned identity, the value will be `system`. In + the case of a system-assigned identity, the Client ID will be determined by the runner. This + identity may be used to authenticate to key vault to retrieve credentials or it may be the only + source of authentication used for accessing the registry. + * + * @return the identity value + */ + public String identity() { + return this.identity; + } + + /** + * Set indicates the managed identity assigned to the custom credential. If a user-assigned identity + this value is the Client ID. If a system-assigned identity, the value will be `system`. In + the case of a system-assigned identity, the Client ID will be determined by the runner. This + identity may be used to authenticate to key vault to retrieve credentials or it may be the only + source of authentication used for accessing the registry. + * + * @param identity the identity value to set + * @return the CustomRegistryCredentials object itself. + */ + public CustomRegistryCredentials withIdentity(String identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DefaultAction.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DefaultAction.java new file mode 100644 index 000000000000..0a3e3697c1d8 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DefaultAction.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for DefaultAction. + */ +public final class DefaultAction extends ExpandableStringEnum { + /** Static value Allow for DefaultAction. */ + public static final DefaultAction ALLOW = fromString("Allow"); + + /** Static value Deny for DefaultAction. */ + public static final DefaultAction DENY = fromString("Deny"); + + /** + * Creates or finds a DefaultAction from its string representation. + * @param name a name to look for + * @return the corresponding DefaultAction + */ + @JsonCreator + public static DefaultAction fromString(String name) { + return fromString(name, DefaultAction.class); + } + + /** + * @return known DefaultAction values + */ + public static Collection values() { + return values(DefaultAction.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildRequest.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildRequest.java new file mode 100644 index 000000000000..23e0b54b9f0f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildRequest.java @@ -0,0 +1,316 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The parameters for a docker quick build. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = DockerBuildRequest.class) +@JsonTypeName("DockerBuildRequest") +public class DockerBuildRequest extends RunRequest { + /** + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /** + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /** + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /** + * The Docker file path relative to the source location. + */ + @JsonProperty(value = "dockerFilePath", required = true) + private String dockerFilePath; + + /** + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The collection of override arguments to be used when executing the run. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /** + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repository. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /** + * The properties that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "credentials") + private Credentials credentials; + + /** + * Get the fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the Docker file path relative to the source location. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source location. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the name of the target build stage for the docker build. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the name of the target build stage for the docker build. + * + * @param target the target value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the collection of override arguments to be used when executing the run. + * + * @return the arguments value + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the collection of override arguments to be used when executing the run. + * + * @param arguments the arguments value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @return the sourceLocation value + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the properties that describes a set of credentials that will be used when this run is invoked. + * + * @return the credentials value + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the properties that describes a set of credentials that will be used when this run is invoked. + * + * @param credentials the credentials value to set + * @return the DockerBuildRequest object itself. + */ + public DockerBuildRequest withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildStep.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildStep.java new file mode 100644 index 000000000000..cad1d1be2a2a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildStep.java @@ -0,0 +1,181 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The Docker build step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = DockerBuildStep.class) +@JsonTypeName("Docker") +public class DockerBuildStep extends TaskStepProperties { + /** + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /** + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /** + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /** + * The Docker file path relative to the source context. + */ + @JsonProperty(value = "dockerFilePath", required = true) + private String dockerFilePath; + + /** + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The collection of override arguments to be used when executing this + * build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /** + * Get the fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the Docker file path relative to the source context. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source context. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the name of the target build stage for the docker build. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the name of the target build stage for the docker build. + * + * @param target the target value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the collection of override arguments to be used when executing this build step. + * + * @return the arguments value + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the collection of override arguments to be used when executing this build step. + * + * @param arguments the arguments value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withArguments(List arguments) { + this.arguments = arguments; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildStepUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildStepUpdateParameters.java new file mode 100644 index 000000000000..c69e52b9ebb2 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/DockerBuildStepUpdateParameters.java @@ -0,0 +1,181 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties for updating a docker build step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = DockerBuildStepUpdateParameters.class) +@JsonTypeName("Docker") +public class DockerBuildStepUpdateParameters extends TaskStepUpdateParameters { + /** + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /** + * The value of this property indicates whether the image built should be + * pushed to the registry or not. + */ + @JsonProperty(value = "isPushEnabled") + private Boolean isPushEnabled; + + /** + * The value of this property indicates whether the image cache is enabled + * or not. + */ + @JsonProperty(value = "noCache") + private Boolean noCache; + + /** + * The Docker file path relative to the source context. + */ + @JsonProperty(value = "dockerFilePath") + private String dockerFilePath; + + /** + * The collection of override arguments to be used when executing this + * build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /** + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /** + * Get the fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the Docker file path relative to the source context. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source context. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the collection of override arguments to be used when executing this build step. + * + * @return the arguments value + */ + public List arguments() { + return this.arguments; + } + + /** + * Set the collection of override arguments to be used when executing this build step. + * + * @param arguments the arguments value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the name of the target build stage for the docker build. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the name of the target build stage for the docker build. + * + * @param target the target value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withTarget(String target) { + this.target = target; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskRunRequest.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskRunRequest.java new file mode 100644 index 000000000000..cb3be288c1f9 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskRunRequest.java @@ -0,0 +1,237 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The parameters for a quick task run request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = EncodedTaskRunRequest.class) +@JsonTypeName("EncodedTaskRunRequest") +public class EncodedTaskRunRequest extends RunRequest { + /** + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent", required = true) + private String encodedTaskContent; + + /** + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repository. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /** + * The properties that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "credentials") + private Credentials credentials; + + /** + * Get base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withValues(List values) { + this.values = values; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @return the sourceLocation value + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the properties that describes a set of credentials that will be used when this run is invoked. + * + * @return the credentials value + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the properties that describes a set of credentials that will be used when this run is invoked. + * + * @param credentials the credentials value to set + * @return the EncodedTaskRunRequest object itself. + */ + public EncodedTaskRunRequest withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskStep.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskStep.java new file mode 100644 index 000000000000..73da0065f4d1 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskStep.java @@ -0,0 +1,101 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a encoded task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = EncodedTaskStep.class) +@JsonTypeName("EncodedTask") +public class EncodedTaskStep extends TaskStepProperties { + /** + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent", required = true) + private String encodedTaskContent; + + /** + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the EncodedTaskStep object itself. + */ + public EncodedTaskStep withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskStepUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskStepUpdateParameters.java new file mode 100644 index 000000000000..d9e48267297e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncodedTaskStepUpdateParameters.java @@ -0,0 +1,101 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties for updating encoded task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = EncodedTaskStepUpdateParameters.class) +@JsonTypeName("EncodedTask") +public class EncodedTaskStepUpdateParameters extends TaskStepUpdateParameters { + /** + * Base64 encoded value of the template/definition file content. + */ + @JsonProperty(value = "encodedTaskContent") + private String encodedTaskContent; + + /** + * Base64 encoded value of the parameters/values file content. + */ + @JsonProperty(value = "encodedValuesContent") + private String encodedValuesContent; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get base64 encoded value of the template/definition file content. + * + * @return the encodedTaskContent value + */ + public String encodedTaskContent() { + return this.encodedTaskContent; + } + + /** + * Set base64 encoded value of the template/definition file content. + * + * @param encodedTaskContent the encodedTaskContent value to set + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withEncodedTaskContent(String encodedTaskContent) { + this.encodedTaskContent = encodedTaskContent; + return this; + } + + /** + * Get base64 encoded value of the parameters/values file content. + * + * @return the encodedValuesContent value + */ + public String encodedValuesContent() { + return this.encodedValuesContent; + } + + /** + * Set base64 encoded value of the parameters/values file content. + * + * @param encodedValuesContent the encodedValuesContent value to set + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withEncodedValuesContent(String encodedValuesContent) { + this.encodedValuesContent = encodedValuesContent; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the EncodedTaskStepUpdateParameters object itself. + */ + public EncodedTaskStepUpdateParameters withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncryptionProperty.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncryptionProperty.java new file mode 100644 index 000000000000..8876b4faac3a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncryptionProperty.java @@ -0,0 +1,70 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The EncryptionProperty model. + */ +public class EncryptionProperty { + /** + * Indicates whether or not the encryption is enabled for container + * registry. Possible values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "status") + private EncryptionStatus status; + + /** + * Key vault properties. + */ + @JsonProperty(value = "keyVaultProperties") + private KeyVaultProperties keyVaultProperties; + + /** + * Get indicates whether or not the encryption is enabled for container registry. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public EncryptionStatus status() { + return this.status; + } + + /** + * Set indicates whether or not the encryption is enabled for container registry. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withStatus(EncryptionStatus status) { + this.status = status; + return this; + } + + /** + * Get key vault properties. + * + * @return the keyVaultProperties value + */ + public KeyVaultProperties keyVaultProperties() { + return this.keyVaultProperties; + } + + /** + * Set key vault properties. + * + * @param keyVaultProperties the keyVaultProperties value to set + * @return the EncryptionProperty object itself. + */ + public EncryptionProperty withKeyVaultProperties(KeyVaultProperties keyVaultProperties) { + this.keyVaultProperties = keyVaultProperties; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncryptionStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncryptionStatus.java new file mode 100644 index 000000000000..719cdedabff7 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EncryptionStatus.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for EncryptionStatus. + */ +public final class EncryptionStatus extends ExpandableStringEnum { + /** Static value enabled for EncryptionStatus. */ + public static final EncryptionStatus ENABLED = fromString("enabled"); + + /** Static value disabled for EncryptionStatus. */ + public static final EncryptionStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a EncryptionStatus from its string representation. + * @param name a name to look for + * @return the corresponding EncryptionStatus + */ + @JsonCreator + public static EncryptionStatus fromString(String name) { + return fromString(name, EncryptionStatus.class); + } + + /** + * @return known EncryptionStatus values + */ + public static Collection values() { + return values(EncryptionStatus.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Error.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Error.java new file mode 100644 index 000000000000..be54197ed3ec --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Error.java @@ -0,0 +1,69 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from the Azure Container Registry service. + */ +public class Error { + /** + * error code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * 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 Error object itself. + */ + public Error 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 Error object itself. + */ + public Error withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ErrorSchema.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ErrorSchema.java new file mode 100644 index 000000000000..8cae56d0fd96 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ErrorSchema.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An error response from the Azure Container Registry service. + */ +public class ErrorSchema { + /** + * Azure container registry build API error body. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get azure container registry build API error body. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set azure container registry build API error body. + * + * @param error the error value to set + * @return the ErrorSchema object itself. + */ + public ErrorSchema withError(Error error) { + this.error = error; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ErrorSchemaException.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ErrorSchemaException.java new file mode 100644 index 000000000000..278cfae7409a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ErrorSchemaException.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_12_01_preview; + +import com.microsoft.rest.RestException; +import okhttp3.ResponseBody; +import retrofit2.Response; + +/** + * Exception thrown for an invalid response with ErrorSchema information. + */ +public class ErrorSchemaException extends RestException { + /** + * Initializes a new instance of the ErrorSchemaException class. + * + * @param message the exception message or the response content if a message is not available + * @param response the HTTP response + */ + public ErrorSchemaException(final String message, final Response response) { + super(message, response); + } + + /** + * Initializes a new instance of the ErrorSchemaException 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 ErrorSchemaException(final String message, final Response response, final ErrorSchema body) { + super(message, response, body); + } + + @Override + public ErrorSchema body() { + return (ErrorSchema) super.body(); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Event.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Event.java new file mode 100644 index 000000000000..5dccc7b20e90 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Event.java @@ -0,0 +1,35 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.EventInner; + +/** + * Type representing Event. + */ +public interface Event extends HasInner, HasManager { + /** + * @return the eventRequestMessage value. + */ + EventRequestMessage eventRequestMessage(); + + /** + * @return the eventResponseMessage value. + */ + EventResponseMessage eventResponseMessage(); + + /** + * @return the id value. + */ + String id(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventContent.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventContent.java new file mode 100644 index 000000000000..aa2bf22b71ba --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventContent.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_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The content of the event request message. + */ +public class EventContent { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The time at which the event occurred. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * The action that encompasses the provided event. + */ + @JsonProperty(value = "action") + private String action; + + /** + * The target of the event. + */ + @JsonProperty(value = "target") + private Target target; + + /** + * The request that generated the event. + */ + @JsonProperty(value = "request") + private Request request; + + /** + * The agent that initiated the event. For most situations, this could be + * from the authorization context of the request. + */ + @JsonProperty(value = "actor") + private Actor actor; + + /** + * The registry node that generated the event. Put differently, while the + * actor initiates the event, the source generates it. + */ + @JsonProperty(value = "source") + private Source source; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventContent object itself. + */ + public EventContent withId(String id) { + this.id = id; + return this; + } + + /** + * Get the time at which the event occurred. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the time at which the event occurred. + * + * @param timestamp the timestamp value to set + * @return the EventContent object itself. + */ + public EventContent withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the action that encompasses the provided event. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the action that encompasses the provided event. + * + * @param action the action value to set + * @return the EventContent object itself. + */ + public EventContent withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the target of the event. + * + * @return the target value + */ + public Target target() { + return this.target; + } + + /** + * Set the target of the event. + * + * @param target the target value to set + * @return the EventContent object itself. + */ + public EventContent withTarget(Target target) { + this.target = target; + return this; + } + + /** + * Get the request that generated the event. + * + * @return the request value + */ + public Request request() { + return this.request; + } + + /** + * Set the request that generated the event. + * + * @param request the request value to set + * @return the EventContent object itself. + */ + public EventContent withRequest(Request request) { + this.request = request; + return this; + } + + /** + * Get the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @return the actor value + */ + public Actor actor() { + return this.actor; + } + + /** + * Set the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @param actor the actor value to set + * @return the EventContent object itself. + */ + public EventContent withActor(Actor actor) { + this.actor = actor; + return this; + } + + /** + * Get the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @return the source value + */ + public Source source() { + return this.source; + } + + /** + * Set the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @param source the source value to set + * @return the EventContent object itself. + */ + public EventContent withSource(Source source) { + this.source = source; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventInfo.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventInfo.java new file mode 100644 index 000000000000..237e47425983 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventInfo.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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.EventInfoInner; + +/** + * Type representing EventInfo. + */ +public interface EventInfo extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventRequestMessage.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventRequestMessage.java new file mode 100644 index 000000000000..0711a406630a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventRequestMessage.java @@ -0,0 +1,148 @@ +/** + * 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_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event request message sent to the service URI. + */ +public class EventRequestMessage { + /** + * The content of the event request message. + */ + @JsonProperty(value = "content") + private EventContent content; + + /** + * The headers of the event request message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The HTTP method used to send the event request message. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The URI used to send the event request message. + */ + @JsonProperty(value = "requestUri") + private String requestUri; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event request message. + * + * @return the content value + */ + public EventContent content() { + return this.content; + } + + /** + * Set the content of the event request message. + * + * @param content the content value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withContent(EventContent content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event request message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event request message. + * + * @param headers the headers value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the HTTP method used to send the event request message. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the HTTP method used to send the event request message. + * + * @param method the method value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the URI used to send the event request message. + * + * @return the requestUri value + */ + public String requestUri() { + return this.requestUri; + } + + /** + * Set the URI used to send the event request message. + * + * @param requestUri the requestUri value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withRequestUri(String requestUri) { + this.requestUri = requestUri; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventResponseMessage.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventResponseMessage.java new file mode 100644 index 000000000000..9bd2af6b99ae --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/EventResponseMessage.java @@ -0,0 +1,148 @@ +/** + * 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_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event response message received from the service URI. + */ +public class EventResponseMessage { + /** + * The content of the event response message. + */ + @JsonProperty(value = "content") + private String content; + + /** + * The headers of the event response message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The reason phrase of the event response message. + */ + @JsonProperty(value = "reasonPhrase") + private String reasonPhrase; + + /** + * The status code of the event response message. + */ + @JsonProperty(value = "statusCode") + private String statusCode; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event response message. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the event response message. + * + * @param content the content value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event response message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event response message. + * + * @param headers the headers value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the reason phrase of the event response message. + * + * @return the reasonPhrase value + */ + public String reasonPhrase() { + return this.reasonPhrase; + } + + /** + * Set the reason phrase of the event response message. + * + * @param reasonPhrase the reasonPhrase value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withReasonPhrase(String reasonPhrase) { + this.reasonPhrase = reasonPhrase; + return this; + } + + /** + * Get the status code of the event response message. + * + * @return the statusCode value + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the status code of the event response message. + * + * @param statusCode the statusCode value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskRunRequest.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskRunRequest.java new file mode 100644 index 000000000000..e891936ff0e1 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskRunRequest.java @@ -0,0 +1,237 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The request parameters for a scheduling run against a task file. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = FileTaskRunRequest.class) +@JsonTypeName("FileTaskRunRequest") +public class FileTaskRunRequest extends RunRequest { + /** + * The template/definition file path relative to the source. + */ + @JsonProperty(value = "taskFilePath", required = true) + private String taskFilePath; + + /** + * The values/parameters file path relative to the source. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Run timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * The URL(absolute or relative) of the source context. It can be an URL to + * a tar or git repository. + * If it is relative URL, the relative path should be obtained from calling + * listBuildSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation") + private String sourceLocation; + + /** + * The properties that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "credentials") + private Credentials credentials; + + /** + * Get the template/definition file path relative to the source. + * + * @return the taskFilePath value + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the template/definition file path relative to the source. + * + * @param taskFilePath the taskFilePath value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the values/parameters file path relative to the source. + * + * @return the valuesFilePath value + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the values/parameters file path relative to the source. + * + * @param valuesFilePath the valuesFilePath value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withValues(List values) { + this.values = values; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @return the sourceLocation value + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + * + * @param sourceLocation the sourceLocation value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the properties that describes a set of credentials that will be used when this run is invoked. + * + * @return the credentials value + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the properties that describes a set of credentials that will be used when this run is invoked. + * + * @param credentials the credentials value to set + * @return the FileTaskRunRequest object itself. + */ + public FileTaskRunRequest withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskStep.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskStep.java new file mode 100644 index 000000000000..82646367390f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskStep.java @@ -0,0 +1,101 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of a task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = FileTaskStep.class) +@JsonTypeName("FileTask") +public class FileTaskStep extends TaskStepProperties { + /** + * The task template/definition file path relative to the source context. + */ + @JsonProperty(value = "taskFilePath", required = true) + private String taskFilePath; + + /** + * The task values/parameters file path relative to the source context. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the task template/definition file path relative to the source context. + * + * @return the taskFilePath value + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the task template/definition file path relative to the source context. + * + * @param taskFilePath the taskFilePath value to set + * @return the FileTaskStep object itself. + */ + public FileTaskStep withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the task values/parameters file path relative to the source context. + * + * @return the valuesFilePath value + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the task values/parameters file path relative to the source context. + * + * @param valuesFilePath the valuesFilePath value to set + * @return the FileTaskStep object itself. + */ + public FileTaskStep withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the FileTaskStep object itself. + */ + public FileTaskStep withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskStepUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskStepUpdateParameters.java new file mode 100644 index 000000000000..692885113cfe --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/FileTaskStepUpdateParameters.java @@ -0,0 +1,101 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The properties of updating a task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = FileTaskStepUpdateParameters.class) +@JsonTypeName("FileTask") +public class FileTaskStepUpdateParameters extends TaskStepUpdateParameters { + /** + * The task template/definition file path relative to the source context. + */ + @JsonProperty(value = "taskFilePath") + private String taskFilePath; + + /** + * The values/parameters file path relative to the source context. + */ + @JsonProperty(value = "valuesFilePath") + private String valuesFilePath; + + /** + * The collection of overridable values that can be passed when running a + * task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Get the task template/definition file path relative to the source context. + * + * @return the taskFilePath value + */ + public String taskFilePath() { + return this.taskFilePath; + } + + /** + * Set the task template/definition file path relative to the source context. + * + * @param taskFilePath the taskFilePath value to set + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withTaskFilePath(String taskFilePath) { + this.taskFilePath = taskFilePath; + return this; + } + + /** + * Get the values/parameters file path relative to the source context. + * + * @return the valuesFilePath value + */ + public String valuesFilePath() { + return this.valuesFilePath; + } + + /** + * Set the values/parameters file path relative to the source context. + * + * @param valuesFilePath the valuesFilePath value to set + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withValuesFilePath(String valuesFilePath) { + this.valuesFilePath = valuesFilePath; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a task. + * + * @param values the values value to set + * @return the FileTaskStepUpdateParameters object itself. + */ + public FileTaskStepUpdateParameters withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/GenerateCredentialsParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/GenerateCredentialsParameters.java new file mode 100644 index 000000000000..b1083de83152 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/GenerateCredentialsParameters.java @@ -0,0 +1,100 @@ +/** + * 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_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to generate credentials for a specified token or user of + * a container registry. + */ +public class GenerateCredentialsParameters { + /** + * The resource ID of the token for which credentials have to be generated. + */ + @JsonProperty(value = "tokenId") + private String tokenId; + + /** + * The expiry date of the generated credentials after which the credentials + * become invalid. + */ + @JsonProperty(value = "expiry") + private DateTime expiry; + + /** + * Specifies name of the password which should be regenerated if any -- + * password1 or password2. Possible values include: 'password1', + * 'password2'. + */ + @JsonProperty(value = "name") + private TokenPasswordName name; + + /** + * Get the resource ID of the token for which credentials have to be generated. + * + * @return the tokenId value + */ + public String tokenId() { + return this.tokenId; + } + + /** + * Set the resource ID of the token for which credentials have to be generated. + * + * @param tokenId the tokenId value to set + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withTokenId(String tokenId) { + this.tokenId = tokenId; + return this; + } + + /** + * Get the expiry date of the generated credentials after which the credentials become invalid. + * + * @return the expiry value + */ + public DateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry date of the generated credentials after which the credentials become invalid. + * + * @param expiry the expiry value to set + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withExpiry(DateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get specifies name of the password which should be regenerated if any -- password1 or password2. Possible values include: 'password1', 'password2'. + * + * @return the name value + */ + public TokenPasswordName name() { + return this.name; + } + + /** + * Set specifies name of the password which should be regenerated if any -- password1 or password2. Possible values include: 'password1', 'password2'. + * + * @param name the name value to set + * @return the GenerateCredentialsParameters object itself. + */ + public GenerateCredentialsParameters withName(TokenPasswordName name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/GenerateCredentialsResult.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/GenerateCredentialsResult.java new file mode 100644 index 000000000000..ab07d26dd47b --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/GenerateCredentialsResult.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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.GenerateCredentialsResultInner; +import java.util.List; + +/** + * Type representing GenerateCredentialsResult. + */ +public interface GenerateCredentialsResult extends HasInner, HasManager { + /** + * @return the passwords value. + */ + List passwords(); + + /** + * @return the username value. + */ + String username(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/IPRule.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/IPRule.java new file mode 100644 index 000000000000..c2e216deff53 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/IPRule.java @@ -0,0 +1,70 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * IP rule with specific IP or IP range in CIDR format. + */ +public class IPRule { + /** + * The action of IP ACL rule. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Specifies the IP or IP range in CIDR format. Only IPV4 address is + * allowed. + */ + @JsonProperty(value = "value", required = true) + private String iPAddressOrRange; + + /** + * Get the action of IP ACL rule. Possible values include: 'Allow'. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action of IP ACL rule. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the IPRule object itself. + */ + public IPRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @return the iPAddressOrRange value + */ + public String iPAddressOrRange() { + return this.iPAddressOrRange; + } + + /** + * Set specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + * + * @param iPAddressOrRange the iPAddressOrRange value to set + * @return the IPRule object itself. + */ + public IPRule withIPAddressOrRange(String iPAddressOrRange) { + this.iPAddressOrRange = iPAddressOrRange; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/IdentityProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/IdentityProperties.java new file mode 100644 index 000000000000..9e7018df7996 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/IdentityProperties.java @@ -0,0 +1,133 @@ +/** + * 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_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Managed identity for the resource. + */ +public class IdentityProperties { + /** + * The principal ID of resource identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * The tenant ID of resource. + */ + @JsonProperty(value = "tenantId") + private String tenantId; + + /** + * The identity type. Possible values include: 'SystemAssigned', + * 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + */ + @JsonProperty(value = "type") + private ResourceIdentityType type; + + /** + * The list of user identities associated with the resource. The user + * identity + * dictionary key references will be ARM resource ids in the form: + * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + * providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + */ + @JsonProperty(value = "userAssignedIdentities") + private Map userAssignedIdentities; + + /** + * Get the principal ID of resource identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principal ID of resource identity. + * + * @param principalId the principalId value to set + * @return the IdentityProperties object itself. + */ + public IdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the tenant ID of resource. + * + * @return the tenantId value + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenant ID of resource. + * + * @param tenantId the tenantId value to set + * @return the IdentityProperties object itself. + */ + public IdentityProperties withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @return the type value + */ + public ResourceIdentityType type() { + return this.type; + } + + /** + * Set the identity type. Possible values include: 'SystemAssigned', 'UserAssigned', 'SystemAssigned, UserAssigned', 'None'. + * + * @param type the type value to set + * @return the IdentityProperties object itself. + */ + public IdentityProperties withType(ResourceIdentityType type) { + this.type = type; + return this; + } + + /** + * Get the list of user identities associated with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @return the userAssignedIdentities value + */ + public Map userAssignedIdentities() { + return this.userAssignedIdentities; + } + + /** + * Set the list of user identities associated with the resource. The user identity + dictionary key references will be ARM resource ids in the form: + '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * + * @param userAssignedIdentities the userAssignedIdentities value to set + * @return the IdentityProperties object itself. + */ + public IdentityProperties withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImageDescriptor.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImageDescriptor.java new file mode 100644 index 000000000000..4ec2affca157 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImageDescriptor.java @@ -0,0 +1,121 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties for a registry image. + */ +public class ImageDescriptor { + /** + * The registry login server. + */ + @JsonProperty(value = "registry") + private String registry; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * The sha256-based digest of the image manifest. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * Get the registry login server. + * + * @return the registry value + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry login server. + * + * @param registry the registry value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withRegistry(String registry) { + this.registry = registry; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the sha256-based digest of the image manifest. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the sha256-based digest of the image manifest. + * + * @param digest the digest value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withDigest(String digest) { + this.digest = digest; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImageUpdateTrigger.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImageUpdateTrigger.java new file mode 100644 index 000000000000..cc285d2b6942 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImageUpdateTrigger.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_12_01_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The image update trigger that caused a build. + */ +public class ImageUpdateTrigger { + /** + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The timestamp when the image update happened. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * The list of image updates that caused the build. + */ + @JsonProperty(value = "images") + private List images; + + /** + * Get the unique ID of the trigger. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the unique ID of the trigger. + * + * @param id the id value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withId(String id) { + this.id = id; + return this; + } + + /** + * Get the timestamp when the image update happened. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp when the image update happened. + * + * @param timestamp the timestamp value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the list of image updates that caused the build. + * + * @return the images value + */ + public List images() { + return this.images; + } + + /** + * Set the list of image updates that caused the build. + * + * @param images the images value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withImages(List images) { + this.images = images; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportImageParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportImageParameters.java new file mode 100644 index 000000000000..eafa3a20447e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportImageParameters.java @@ -0,0 +1,126 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportImageParameters model. + */ +public class ImportImageParameters { + /** + * The source of the image. + */ + @JsonProperty(value = "source", required = true) + private ImportSource source; + + /** + * List of strings of the form repo[:tag]. When tag is omitted the source + * will be used (or 'latest' if source tag is also omitted). + */ + @JsonProperty(value = "targetTags") + private List targetTags; + + /** + * List of strings of repository names to do a manifest only copy. No tag + * will be created. + */ + @JsonProperty(value = "untaggedTargetRepositories") + private List untaggedTargetRepositories; + + /** + * When Force, any existing target tags will be overwritten. When NoForce, + * any existing target tags will fail the operation before any copying + * begins. Possible values include: 'NoForce', 'Force'. + */ + @JsonProperty(value = "mode") + private ImportMode mode; + + /** + * Get the source of the image. + * + * @return the source value + */ + public ImportSource source() { + return this.source; + } + + /** + * Set the source of the image. + * + * @param source the source value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withSource(ImportSource source) { + this.source = source; + return this; + } + + /** + * Get list of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + * + * @return the targetTags value + */ + public List targetTags() { + return this.targetTags; + } + + /** + * Set list of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + * + * @param targetTags the targetTags value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withTargetTags(List targetTags) { + this.targetTags = targetTags; + return this; + } + + /** + * Get list of strings of repository names to do a manifest only copy. No tag will be created. + * + * @return the untaggedTargetRepositories value + */ + public List untaggedTargetRepositories() { + return this.untaggedTargetRepositories; + } + + /** + * Set list of strings of repository names to do a manifest only copy. No tag will be created. + * + * @param untaggedTargetRepositories the untaggedTargetRepositories value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withUntaggedTargetRepositories(List untaggedTargetRepositories) { + this.untaggedTargetRepositories = untaggedTargetRepositories; + return this; + } + + /** + * Get when Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'. + * + * @return the mode value + */ + public ImportMode mode() { + return this.mode; + } + + /** + * Set when Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'. + * + * @param mode the mode value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withMode(ImportMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportMode.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportMode.java new file mode 100644 index 000000000000..c4ac56b076d3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportMode.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImportMode. + */ +public final class ImportMode extends ExpandableStringEnum { + /** Static value NoForce for ImportMode. */ + public static final ImportMode NO_FORCE = fromString("NoForce"); + + /** Static value Force for ImportMode. */ + public static final ImportMode FORCE = fromString("Force"); + + /** + * Creates or finds a ImportMode from its string representation. + * @param name a name to look for + * @return the corresponding ImportMode + */ + @JsonCreator + public static ImportMode fromString(String name) { + return fromString(name, ImportMode.class); + } + + /** + * @return known ImportMode values + */ + public static Collection values() { + return values(ImportMode.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportSource.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportSource.java new file mode 100644 index 000000000000..7f7f1f52a260 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportSource.java @@ -0,0 +1,132 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportSource model. + */ +public class ImportSource { + /** + * The resource identifier of the source Azure Container Registry. + */ + @JsonProperty(value = "resourceId") + private String resourceId; + + /** + * The address of the source registry (e.g. 'mcr.microsoft.com'). + */ + @JsonProperty(value = "registryUri") + private String registryUri; + + /** + * Credentials used when importing from a registry uri. + */ + @JsonProperty(value = "credentials") + private ImportSourceCredentials credentials; + + /** + * Repository name of the source image. + * Specify an image by repository ('hello-world'). This will use the + * 'latest' tag. + * Specify an image by tag ('hello-world:latest'). + * Specify an image by sha256-based manifest digest + * ('hello-world@sha256:abc123'). + */ + @JsonProperty(value = "sourceImage", required = true) + private String sourceImage; + + /** + * Get the resource identifier of the source Azure Container Registry. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resource identifier of the source Azure Container Registry. + * + * @param resourceId the resourceId value to set + * @return the ImportSource object itself. + */ + public ImportSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the address of the source registry (e.g. 'mcr.microsoft.com'). + * + * @return the registryUri value + */ + public String registryUri() { + return this.registryUri; + } + + /** + * Set the address of the source registry (e.g. 'mcr.microsoft.com'). + * + * @param registryUri the registryUri value to set + * @return the ImportSource object itself. + */ + public ImportSource withRegistryUri(String registryUri) { + this.registryUri = registryUri; + return this; + } + + /** + * Get credentials used when importing from a registry uri. + * + * @return the credentials value + */ + public ImportSourceCredentials credentials() { + return this.credentials; + } + + /** + * Set credentials used when importing from a registry uri. + * + * @param credentials the credentials value to set + * @return the ImportSource object itself. + */ + public ImportSource withCredentials(ImportSourceCredentials credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @return the sourceImage value + */ + public String sourceImage() { + return this.sourceImage; + } + + /** + * Set repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @param sourceImage the sourceImage value to set + * @return the ImportSource object itself. + */ + public ImportSource withSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportSourceCredentials.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportSourceCredentials.java new file mode 100644 index 000000000000..36eaead4d291 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ImportSourceCredentials.java @@ -0,0 +1,69 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportSourceCredentials model. + */ +public class ImportSourceCredentials { + /** + * The username to authenticate with the source registry. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The password used to authenticate with the source registry. + */ + @JsonProperty(value = "password", required = true) + private String password; + + /** + * Get the username to authenticate with the source registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username to authenticate with the source registry. + * + * @param username the username value to set + * @return the ImportSourceCredentials object itself. + */ + public ImportSourceCredentials withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the password used to authenticate with the source registry. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the password used to authenticate with the source registry. + * + * @param password the password value to set + * @return the ImportSourceCredentials object itself. + */ + public ImportSourceCredentials withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/KeyVaultProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/KeyVaultProperties.java new file mode 100644 index 000000000000..0d07bed54d49 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/KeyVaultProperties.java @@ -0,0 +1,85 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The KeyVaultProperties model. + */ +public class KeyVaultProperties { + /** + * Key vault uri to access the encryption key. + */ + @JsonProperty(value = "keyIdentifier") + private String keyIdentifier; + + /** + * The fully qualified key identifier that includes the version of the key + * that is actually used for encryption. + */ + @JsonProperty(value = "versionedKeyIdentifier", access = JsonProperty.Access.WRITE_ONLY) + private String versionedKeyIdentifier; + + /** + * The client id of the identity which will be used to access key vault. + */ + @JsonProperty(value = "identity") + private String identity; + + /** + * Get key vault uri to access the encryption key. + * + * @return the keyIdentifier value + */ + public String keyIdentifier() { + return this.keyIdentifier; + } + + /** + * Set key vault uri to access the encryption key. + * + * @param keyIdentifier the keyIdentifier value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withKeyIdentifier(String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Get the fully qualified key identifier that includes the version of the key that is actually used for encryption. + * + * @return the versionedKeyIdentifier value + */ + public String versionedKeyIdentifier() { + return this.versionedKeyIdentifier; + } + + /** + * Get the client id of the identity which will be used to access key vault. + * + * @return the identity value + */ + public String identity() { + return this.identity; + } + + /** + * Set the client id of the identity which will be used to access key vault. + * + * @param identity the identity value to set + * @return the KeyVaultProperties object itself. + */ + public KeyVaultProperties withIdentity(String identity) { + this.identity = identity; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/NetworkRuleSet.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/NetworkRuleSet.java new file mode 100644 index 000000000000..bc4f055129c3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/NetworkRuleSet.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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The network rule set for a container registry. + */ +public class NetworkRuleSet { + /** + * The default action of allow or deny when no other rules match. Possible + * values include: 'Allow', 'Deny'. + */ + @JsonProperty(value = "defaultAction", required = true) + private DefaultAction defaultAction; + + /** + * The virtual network rules. + */ + @JsonProperty(value = "virtualNetworkRules") + private List virtualNetworkRules; + + /** + * The IP ACL rules. + */ + @JsonProperty(value = "ipRules") + private List ipRules; + + /** + * Get the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. + * + * @return the defaultAction value + */ + public DefaultAction defaultAction() { + return this.defaultAction; + } + + /** + * Set the default action of allow or deny when no other rules match. Possible values include: 'Allow', 'Deny'. + * + * @param defaultAction the defaultAction value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withDefaultAction(DefaultAction defaultAction) { + this.defaultAction = defaultAction; + return this; + } + + /** + * Get the virtual network rules. + * + * @return the virtualNetworkRules value + */ + public List virtualNetworkRules() { + return this.virtualNetworkRules; + } + + /** + * Set the virtual network rules. + * + * @param virtualNetworkRules the virtualNetworkRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withVirtualNetworkRules(List virtualNetworkRules) { + this.virtualNetworkRules = virtualNetworkRules; + return this; + } + + /** + * Get the IP ACL rules. + * + * @return the ipRules value + */ + public List ipRules() { + return this.ipRules; + } + + /** + * Set the IP ACL rules. + * + * @param ipRules the ipRules value to set + * @return the NetworkRuleSet object itself. + */ + public NetworkRuleSet withIpRules(List ipRules) { + this.ipRules = ipRules; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OS.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OS.java new file mode 100644 index 000000000000..c1e88c5f8955 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OS.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OS. + */ +public final class OS extends ExpandableStringEnum { + /** Static value Windows for OS. */ + public static final OS WINDOWS = fromString("Windows"); + + /** Static value Linux for OS. */ + public static final OS LINUX = fromString("Linux"); + + /** + * Creates or finds a OS from its string representation. + * @param name a name to look for + * @return the corresponding OS + */ + @JsonCreator + public static OS fromString(String name) { + return fromString(name, OS.class); + } + + /** + * @return known OS values + */ + public static Collection values() { + return values(OS.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationDefinition.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationDefinition.java new file mode 100644 index 000000000000..6abfd8167f73 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationDefinition.java @@ -0,0 +1,40 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.OperationDefinitionInner; + +/** + * Type representing OperationDefinition. + */ +public interface OperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplayDefinition display(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the origin value. + */ + String origin(); + + /** + * @return the serviceSpecification value. + */ + OperationServiceSpecificationDefinition serviceSpecification(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationDisplayDefinition.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationDisplayDefinition.java new file mode 100644 index 000000000000..ed61d03a8c61 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationDisplayDefinition.java @@ -0,0 +1,121 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a container registry operation. + */ +public class OperationDisplayDefinition { + /** + * The resource provider name: Microsoft.ContainerRegistry. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the resource provider name: Microsoft.ContainerRegistry. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the resource provider name: Microsoft.ContainerRegistry. + * + * @param provider the provider value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that users can perform. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that users can perform. + * + * @param operation the operation value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the operation. + * + * @param description the description value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationMetricSpecificationDefinition.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationMetricSpecificationDefinition.java new file mode 100644 index 000000000000..7fa334c1f38e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationMetricSpecificationDefinition.java @@ -0,0 +1,173 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of Azure Monitoring metric. + */ +public class OperationMetricSpecificationDefinition { + /** + * Metric name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Metric display name. + */ + @JsonProperty(value = "displayName") + private String displayName; + + /** + * Metric description. + */ + @JsonProperty(value = "displayDescription") + private String displayDescription; + + /** + * Metric unit. + */ + @JsonProperty(value = "unit") + private String unit; + + /** + * Metric aggregation type. + */ + @JsonProperty(value = "aggregationType") + private String aggregationType; + + /** + * Internal metric name. + */ + @JsonProperty(value = "internalMetricName") + private String internalMetricName; + + /** + * Get metric name. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set metric name. + * + * @param name the name value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withName(String name) { + this.name = name; + return this; + } + + /** + * Get metric display name. + * + * @return the displayName value + */ + public String displayName() { + return this.displayName; + } + + /** + * Set metric display name. + * + * @param displayName the displayName value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get metric description. + * + * @return the displayDescription value + */ + public String displayDescription() { + return this.displayDescription; + } + + /** + * Set metric description. + * + * @param displayDescription the displayDescription value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withDisplayDescription(String displayDescription) { + this.displayDescription = displayDescription; + return this; + } + + /** + * Get metric unit. + * + * @return the unit value + */ + public String unit() { + return this.unit; + } + + /** + * Set metric unit. + * + * @param unit the unit value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withUnit(String unit) { + this.unit = unit; + return this; + } + + /** + * Get metric aggregation type. + * + * @return the aggregationType value + */ + public String aggregationType() { + return this.aggregationType; + } + + /** + * Set metric aggregation type. + * + * @param aggregationType the aggregationType value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withAggregationType(String aggregationType) { + this.aggregationType = aggregationType; + return this; + } + + /** + * Get internal metric name. + * + * @return the internalMetricName value + */ + public String internalMetricName() { + return this.internalMetricName; + } + + /** + * Set internal metric name. + * + * @param internalMetricName the internalMetricName value to set + * @return the OperationMetricSpecificationDefinition object itself. + */ + public OperationMetricSpecificationDefinition withInternalMetricName(String internalMetricName) { + this.internalMetricName = internalMetricName; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationServiceSpecificationDefinition.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationServiceSpecificationDefinition.java new file mode 100644 index 000000000000..68dc4835bf96 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OperationServiceSpecificationDefinition.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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of Azure Monitoring list. + */ +public class OperationServiceSpecificationDefinition { + /** + * A list of Azure Monitoring metrics definition. + */ + @JsonProperty(value = "metricSpecifications") + private List metricSpecifications; + + /** + * Get a list of Azure Monitoring metrics definition. + * + * @return the metricSpecifications value + */ + public List metricSpecifications() { + return this.metricSpecifications; + } + + /** + * Set a list of Azure Monitoring metrics definition. + * + * @param metricSpecifications the metricSpecifications value to set + * @return the OperationServiceSpecificationDefinition object itself. + */ + public OperationServiceSpecificationDefinition withMetricSpecifications(List metricSpecifications) { + this.metricSpecifications = metricSpecifications; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Operations.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Operations.java new file mode 100644 index 000000000000..1604e5075dda --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * 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_12_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OverrideTaskStepProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OverrideTaskStepProperties.java new file mode 100644 index 000000000000..ab0431aea49e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/OverrideTaskStepProperties.java @@ -0,0 +1,179 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The OverrideTaskStepProperties model. + */ +public class OverrideTaskStepProperties { + /** + * The source context against which run has to be queued. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /** + * The file against which run has to be queued. + */ + @JsonProperty(value = "file") + private String file; + + /** + * Gets or sets the collection of override arguments to be used when + * executing a build step. + */ + @JsonProperty(value = "arguments") + private List arguments; + + /** + * The name of the target build stage for the docker build. + */ + @JsonProperty(value = "target") + private String target; + + /** + * The collection of overridable values that can be passed when running a + * Task. + */ + @JsonProperty(value = "values") + private List values; + + /** + * Base64 encoded update trigger token that will be attached with the base + * image trigger webhook. + */ + @JsonProperty(value = "updateTriggerToken") + private String updateTriggerToken; + + /** + * Get the source context against which run has to be queued. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the source context against which run has to be queued. + * + * @param contextPath the contextPath value to set + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the file against which run has to be queued. + * + * @return the file value + */ + public String file() { + return this.file; + } + + /** + * Set the file against which run has to be queued. + * + * @param file the file value to set + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withFile(String file) { + this.file = file; + return this; + } + + /** + * Get gets or sets the collection of override arguments to be used when + executing a build step. + * + * @return the arguments value + */ + public List arguments() { + return this.arguments; + } + + /** + * Set gets or sets the collection of override arguments to be used when + executing a build step. + * + * @param arguments the arguments value to set + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withArguments(List arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the name of the target build stage for the docker build. + * + * @return the target value + */ + public String target() { + return this.target; + } + + /** + * Set the name of the target build stage for the docker build. + * + * @param target the target value to set + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withTarget(String target) { + this.target = target; + return this; + } + + /** + * Get the collection of overridable values that can be passed when running a Task. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the collection of overridable values that can be passed when running a Task. + * + * @param values the values value to set + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withValues(List values) { + this.values = values; + return this; + } + + /** + * Get base64 encoded update trigger token that will be attached with the base image trigger webhook. + * + * @return the updateTriggerToken value + */ + public String updateTriggerToken() { + return this.updateTriggerToken; + } + + /** + * Set base64 encoded update trigger token that will be attached with the base image trigger webhook. + * + * @param updateTriggerToken the updateTriggerToken value to set + * @return the OverrideTaskStepProperties object itself. + */ + public OverrideTaskStepProperties withUpdateTriggerToken(String updateTriggerToken) { + this.updateTriggerToken = updateTriggerToken; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PasswordName.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PasswordName.java new file mode 100644 index 000000000000..dc0960a49363 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PasswordName.java @@ -0,0 +1,53 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PasswordName. + */ +public enum PasswordName { + /** Enum value password. */ + PASSWORD("password"), + + /** Enum value password2. */ + PASSWORD2("password2"); + + /** The actual serialized value for a PasswordName instance. */ + private String value; + + PasswordName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PasswordName instance. + * + * @param value the serialized value to parse. + * @return the parsed PasswordName object, or null if unable to parse. + */ + @JsonCreator + public static PasswordName fromString(String value) { + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PlatformProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PlatformProperties.java new file mode 100644 index 000000000000..df324a9cf332 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PlatformProperties.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The platform properties against which the run has to happen. + */ +public class PlatformProperties { + /** + * The operating system type required for the run. Possible values include: + * 'Windows', 'Linux'. + */ + @JsonProperty(value = "os", required = true) + private OS os; + + /** + * The OS architecture. Possible values include: 'amd64', 'x86', '386', + * 'arm', 'arm64'. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /** + * Variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + */ + @JsonProperty(value = "variant") + private Variant variant; + + /** + * Get the operating system type required for the run. Possible values include: 'Windows', 'Linux'. + * + * @return the os value + */ + public OS os() { + return this.os; + } + + /** + * Set the operating system type required for the run. Possible values include: 'Windows', 'Linux'. + * + * @param os the os value to set + * @return the PlatformProperties object itself. + */ + public PlatformProperties withOs(OS os) { + this.os = os; + return this; + } + + /** + * Get the OS architecture. Possible values include: 'amd64', 'x86', '386', 'arm', 'arm64'. + * + * @return the architecture value + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the OS architecture. Possible values include: 'amd64', 'x86', '386', 'arm', 'arm64'. + * + * @param architecture the architecture value to set + * @return the PlatformProperties object itself. + */ + public PlatformProperties withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + * + * @return the variant value + */ + public Variant variant() { + return this.variant; + } + + /** + * Set variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + * + * @param variant the variant value to set + * @return the PlatformProperties object itself. + */ + public PlatformProperties withVariant(Variant variant) { + this.variant = variant; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PlatformUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PlatformUpdateParameters.java new file mode 100644 index 000000000000..d69490e0197e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PlatformUpdateParameters.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating the platform configuration. + */ +public class PlatformUpdateParameters { + /** + * The operating system type required for the run. Possible values include: + * 'Windows', 'Linux'. + */ + @JsonProperty(value = "os") + private OS os; + + /** + * The OS architecture. Possible values include: 'amd64', 'x86', '386', + * 'arm', 'arm64'. + */ + @JsonProperty(value = "architecture") + private Architecture architecture; + + /** + * Variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + */ + @JsonProperty(value = "variant") + private Variant variant; + + /** + * Get the operating system type required for the run. Possible values include: 'Windows', 'Linux'. + * + * @return the os value + */ + public OS os() { + return this.os; + } + + /** + * Set the operating system type required for the run. Possible values include: 'Windows', 'Linux'. + * + * @param os the os value to set + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withOs(OS os) { + this.os = os; + return this; + } + + /** + * Get the OS architecture. Possible values include: 'amd64', 'x86', '386', 'arm', 'arm64'. + * + * @return the architecture value + */ + public Architecture architecture() { + return this.architecture; + } + + /** + * Set the OS architecture. Possible values include: 'amd64', 'x86', '386', 'arm', 'arm64'. + * + * @param architecture the architecture value to set + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withArchitecture(Architecture architecture) { + this.architecture = architecture; + return this; + } + + /** + * Get variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + * + * @return the variant value + */ + public Variant variant() { + return this.variant; + } + + /** + * Set variant of the CPU. Possible values include: 'v6', 'v7', 'v8'. + * + * @param variant the variant value to set + * @return the PlatformUpdateParameters object itself. + */ + public PlatformUpdateParameters withVariant(Variant variant) { + this.variant = variant; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Policies.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Policies.java new file mode 100644 index 000000000000..731d8234de77 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Policies.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The policies for a container registry. + */ +public class Policies { + /** + * The quarantine policy for a container registry. + */ + @JsonProperty(value = "quarantinePolicy") + private QuarantinePolicy quarantinePolicy; + + /** + * The content trust policy for a container registry. + */ + @JsonProperty(value = "trustPolicy") + private TrustPolicy trustPolicy; + + /** + * The retention policy for a container registry. + */ + @JsonProperty(value = "retentionPolicy") + private RetentionPolicy retentionPolicy; + + /** + * Get the quarantine policy for a container registry. + * + * @return the quarantinePolicy value + */ + public QuarantinePolicy quarantinePolicy() { + return this.quarantinePolicy; + } + + /** + * Set the quarantine policy for a container registry. + * + * @param quarantinePolicy the quarantinePolicy value to set + * @return the Policies object itself. + */ + public Policies withQuarantinePolicy(QuarantinePolicy quarantinePolicy) { + this.quarantinePolicy = quarantinePolicy; + return this; + } + + /** + * Get the content trust policy for a container registry. + * + * @return the trustPolicy value + */ + public TrustPolicy trustPolicy() { + return this.trustPolicy; + } + + /** + * Set the content trust policy for a container registry. + * + * @param trustPolicy the trustPolicy value to set + * @return the Policies object itself. + */ + public Policies withTrustPolicy(TrustPolicy trustPolicy) { + this.trustPolicy = trustPolicy; + return this; + } + + /** + * Get the retention policy for a container registry. + * + * @return the retentionPolicy value + */ + public RetentionPolicy retentionPolicy() { + return this.retentionPolicy; + } + + /** + * Set the retention policy for a container registry. + * + * @param retentionPolicy the retentionPolicy value to set + * @return the Policies object itself. + */ + public Policies withRetentionPolicy(RetentionPolicy retentionPolicy) { + this.retentionPolicy = retentionPolicy; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PolicyStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PolicyStatus.java new file mode 100644 index 000000000000..19c02ee3d0fe --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PolicyStatus.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for PolicyStatus. + */ +public final class PolicyStatus extends ExpandableStringEnum { + /** Static value enabled for PolicyStatus. */ + public static final PolicyStatus ENABLED = fromString("enabled"); + + /** Static value disabled for PolicyStatus. */ + public static final PolicyStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a PolicyStatus from its string representation. + * @param name a name to look for + * @return the corresponding PolicyStatus + */ + @JsonCreator + public static PolicyStatus fromString(String name) { + return fromString(name, PolicyStatus.class); + } + + /** + * @return known PolicyStatus values + */ + public static Collection values() { + return values(PolicyStatus.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpoint.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpoint.java new file mode 100644 index 000000000000..b03931ceaeef --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpoint.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The Private Endpoint resource. + */ +public class PrivateEndpoint { + /** + * This is private endpoint resource created with Microsoft.Network + * resource provider. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get this is private endpoint resource created with Microsoft.Network resource provider. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set this is private endpoint resource created with Microsoft.Network resource provider. + * + * @param id the id value to set + * @return the PrivateEndpoint object itself. + */ + public PrivateEndpoint withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpointConnection.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpointConnection.java new file mode 100644 index 000000000000..7291b71287cd --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpointConnection.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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.PrivateEndpointConnectionInner; +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_12_01_preview.implementation.ContainerRegistryManager; + +/** + * Type representing PrivateEndpointConnection. + */ +public interface PrivateEndpointConnection extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the privateEndpoint value. + */ + PrivateEndpoint privateEndpoint(); + + /** + * @return the privateLinkServiceConnectionState value. + */ + PrivateLinkServiceConnectionState privateLinkServiceConnectionState(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the PrivateEndpointConnection definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithCreate { + } + + /** + * Grouping of PrivateEndpointConnection definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a PrivateEndpointConnection definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the privateendpointconnection 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 privateendpointconnection definition allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The resource of private endpoint + * @return the next definition stage + */ + WithCreate withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection definition allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState A collection of information about the state of the connection between service consumer and provider + * @return the next definition stage + */ + WithCreate withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + + /** + * 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.WithPrivateEndpoint, DefinitionStages.WithPrivateLinkServiceConnectionState { + } + } + /** + * The template for a PrivateEndpointConnection update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithPrivateEndpoint, UpdateStages.WithPrivateLinkServiceConnectionState { + } + + /** + * Grouping of PrivateEndpointConnection update stages. + */ + interface UpdateStages { + /** + * The stage of the privateendpointconnection update allowing to specify PrivateEndpoint. + */ + interface WithPrivateEndpoint { + /** + * Specifies privateEndpoint. + * @param privateEndpoint The resource of private endpoint + * @return the next update stage + */ + Update withPrivateEndpoint(PrivateEndpoint privateEndpoint); + } + + /** + * The stage of the privateendpointconnection update allowing to specify PrivateLinkServiceConnectionState. + */ + interface WithPrivateLinkServiceConnectionState { + /** + * Specifies privateLinkServiceConnectionState. + * @param privateLinkServiceConnectionState A collection of information about the state of the connection between service consumer and provider + * @return the next update stage + */ + Update withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpointConnections.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpointConnections.java new file mode 100644 index 000000000000..afe3e4e08e81 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateEndpointConnections.java @@ -0,0 +1,53 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.PrivateEndpointConnectionsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing PrivateEndpointConnections. + */ +public interface PrivateEndpointConnections extends SupportsCreating, HasInner { + /** + * Get the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName); + + /** + * List all private endpoint connections in a 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 the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateLinkResource.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateLinkResource.java new file mode 100644 index 000000000000..9e8e5e129877 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateLinkResource.java @@ -0,0 +1,51 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.PrivateLinkResourceInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import java.util.List; + +/** + * Type representing PrivateLinkResource. + */ +public interface PrivateLinkResource extends HasInner, HasManager { + /** + * @return the groupId value. + */ + String groupId(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the requiredMembers value. + */ + List requiredMembers(); + + /** + * @return the requiredZoneNames value. + */ + List requiredZoneNames(); + + /** + * @return the type value. + */ + String type(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateLinkServiceConnectionState.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateLinkServiceConnectionState.java new file mode 100644 index 000000000000..4ca3f6598c66 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/PrivateLinkServiceConnectionState.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The state of a private link service connection. + */ +public class PrivateLinkServiceConnectionState { + /** + * The private link service connection status. Possible values include: + * 'Approved', 'Pending', 'Rejected', 'Disconnected'. + */ + @JsonProperty(value = "status") + private Status status; + + /** + * The description for connection status. For example if connection is + * rejected it can indicate reason for rejection. + */ + @JsonProperty(value = "description") + private String description; + + /** + * A message indicating if changes on the service provider require any + * updates on the consumer. Possible values include: 'None', 'Recreate'. + */ + @JsonProperty(value = "actionsRequired") + private ActionsRequired actionsRequired; + + /** + * Get the private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'. + * + * @return the status value + */ + public Status status() { + return this.status; + } + + /** + * Set the private link service connection status. Possible values include: 'Approved', 'Pending', 'Rejected', 'Disconnected'. + * + * @param status the status value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withStatus(Status status) { + this.status = status; + return this; + } + + /** + * Get the description for connection status. For example if connection is rejected it can indicate reason for rejection. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for connection status. For example if connection is rejected it can indicate reason for rejection. + * + * @param description the description value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get a message indicating if changes on the service provider require any updates on the consumer. Possible values include: 'None', 'Recreate'. + * + * @return the actionsRequired value + */ + public ActionsRequired actionsRequired() { + return this.actionsRequired; + } + + /** + * Set a message indicating if changes on the service provider require any updates on the consumer. Possible values include: 'None', 'Recreate'. + * + * @param actionsRequired the actionsRequired value to set + * @return the PrivateLinkServiceConnectionState object itself. + */ + public PrivateLinkServiceConnectionState withActionsRequired(ActionsRequired actionsRequired) { + this.actionsRequired = actionsRequired; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ProvisioningState.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ProvisioningState.java new file mode 100644 index 000000000000..9d832feeb653 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/QuarantinePolicy.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/QuarantinePolicy.java new file mode 100644 index 000000000000..c02cb08a6d8d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/QuarantinePolicy.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quarantine policy for a container registry. + */ +public class QuarantinePolicy { + /** + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the QuarantinePolicy object itself. + */ + public QuarantinePolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegenerateCredentialParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegenerateCredentialParameters.java new file mode 100644 index 000000000000..be73ba923304 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegenerateCredentialParameters.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the login credential. + */ +public class RegenerateCredentialParameters { + /** + * Specifies name of the password which should be regenerated -- password + * or password2. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** + * Get specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegenerateCredentialParameters object itself. + */ + public RegenerateCredentialParameters withName(PasswordName name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Registries.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Registries.java new file mode 100644 index 000000000000..3e55287254cb --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Registries.java @@ -0,0 +1,120 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.RegistriesInner; +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateLinkResource; + +/** + * Type representing Registries. + */ +public interface Registries extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * Lists the login credentials for the 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 listCredentialsAsync(String resourceGroupName, String registryName); + + /** + * Regenerates one of the login credentials for the 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 name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable generateCredentialsAsync(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + + /** + * Gets the quota usages for the 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 listUsagesAsync(String resourceGroupName, String registryName); + + /** + * Lists the private link resources for a 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 listPrivateLinkResourcesAsync(final String resourceGroupName, final String registryName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Registry.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Registry.java new file mode 100644 index 000000000000..35f866794bab --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Registry.java @@ -0,0 +1,320 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +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_12_01_preview.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.RegistryInner; + +/** + * Type representing Registry. + */ +public interface Registry extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the dataEndpointEnabled value. + */ + Boolean dataEndpointEnabled(); + + /** + * @return the dataEndpointHostNames value. + */ + List dataEndpointHostNames(); + + /** + * @return the encryption value. + */ + EncryptionProperty encryption(); + + /** + * @return the identity value. + */ + IdentityProperties identity(); + + /** + * @return the loginServer value. + */ + String loginServer(); + + /** + * @return the networkRuleSet value. + */ + NetworkRuleSet networkRuleSet(); + + /** + * @return the policies value. + */ + Policies policies(); + + /** + * @return the privateEndpointConnections value. + */ + List privateEndpointConnections(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + Status1 status(); + + /** + * @return the storageAccount value. + */ + StorageAccountProperties storageAccount(); + + /** + * The entirety of the Registry definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of Registry definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Registry definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Registry definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the registry definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the container registry + * @return the next definition stage +*/ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the registry definition allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + * @param adminUserEnabled The value that indicates whether the admin user is enabled + * @return the next definition stage + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry definition allowing to specify DataEndpointEnabled. + */ + interface WithDataEndpointEnabled { + /** + * Specifies dataEndpointEnabled. + * @param dataEndpointEnabled Enable a single data endpoint per region for serving data + * @return the next definition stage + */ + WithCreate withDataEndpointEnabled(Boolean dataEndpointEnabled); + } + + /** + * The stage of the registry definition allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption The encryption settings of container registry + * @return the next definition stage + */ + WithCreate withEncryption(EncryptionProperty encryption); + } + + /** + * The stage of the registry definition allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the container registry + * @return the next definition stage + */ + WithCreate withIdentity(IdentityProperties identity); + } + + /** + * The stage of the registry definition allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + * @param networkRuleSet The network rule set for a container registry + * @return the next definition stage + */ + WithCreate withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the registry definition allowing to specify Policies. + */ + interface WithPolicies { + /** + * Specifies policies. + * @param policies The policies for a container registry + * @return the next definition stage + */ + WithCreate withPolicies(Policies policies); + } + + /** + * The stage of the registry definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + * @param storageAccount The properties of the storage account for the container registry. Only applicable to Classic SKU + * @return the next definition stage + */ + WithCreate withStorageAccount(StorageAccountProperties storageAccount); + } + + /** + * 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, Resource.DefinitionWithTags, DefinitionStages.WithAdminUserEnabled, DefinitionStages.WithDataEndpointEnabled, DefinitionStages.WithEncryption, DefinitionStages.WithIdentity, DefinitionStages.WithNetworkRuleSet, DefinitionStages.WithPolicies, DefinitionStages.WithStorageAccount { + } + } + /** + * The template for a Registry update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdminUserEnabled, UpdateStages.WithDataEndpointEnabled, UpdateStages.WithEncryption, UpdateStages.WithIdentity, UpdateStages.WithNetworkRuleSet, UpdateStages.WithPolicies, UpdateStages.WithSku { + } + + /** + * Grouping of Registry update stages. + */ + interface UpdateStages { + /** + * The stage of the registry update allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + * @param adminUserEnabled The value that indicates whether the admin user is enabled + * @return the next update stage + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry update allowing to specify DataEndpointEnabled. + */ + interface WithDataEndpointEnabled { + /** + * Specifies dataEndpointEnabled. + * @param dataEndpointEnabled Enable a single data endpoint per region for serving data + * @return the next update stage + */ + Update withDataEndpointEnabled(Boolean dataEndpointEnabled); + } + + /** + * The stage of the registry update allowing to specify Encryption. + */ + interface WithEncryption { + /** + * Specifies encryption. + * @param encryption The encryption settings of container registry + * @return the next update stage + */ + Update withEncryption(EncryptionProperty encryption); + } + + /** + * The stage of the registry update allowing to specify Identity. + */ + interface WithIdentity { + /** + * Specifies identity. + * @param identity The identity of the container registry + * @return the next update stage + */ + Update withIdentity(IdentityProperties identity); + } + + /** + * The stage of the registry update allowing to specify NetworkRuleSet. + */ + interface WithNetworkRuleSet { + /** + * Specifies networkRuleSet. + * @param networkRuleSet The network rule set for a container registry + * @return the next update stage + */ + Update withNetworkRuleSet(NetworkRuleSet networkRuleSet); + } + + /** + * The stage of the registry update allowing to specify Policies. + */ + interface WithPolicies { + /** + * Specifies policies. + * @param policies The policies for a container registry + * @return the next update stage + */ + Update withPolicies(Policies policies); + } + + /** + * The stage of the registry update allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + * @param sku The SKU of the container registry + * @return the next update stage + */ + Update withSku(Sku sku); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryListCredentialsResult.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryListCredentialsResult.java new file mode 100644 index 000000000000..3bf49f709635 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryListCredentialsResult.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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.RegistryListCredentialsResultInner; +import java.util.List; + +/** + * Type representing RegistryListCredentialsResult. + */ +public interface RegistryListCredentialsResult extends HasInner, HasManager { + /** + * @return the passwords value. + */ + List passwords(); + + /** + * @return the username value. + */ + String username(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryNameCheckRequest.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryNameCheckRequest.java new file mode 100644 index 000000000000..4b5999e32519 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryNameCheckRequest.java @@ -0,0 +1,78 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A request to check whether a container registry name is available. + */ +public class RegistryNameCheckRequest { + /** + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of RegistryNameCheckRequest class. + * @param name the name of the container registry. + */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name of the container registry. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container registry. + * + * @param name the name value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @param type the type value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryNameStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryNameStatus.java new file mode 100644 index 000000000000..34c57afed2bc --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryNameStatus.java @@ -0,0 +1,35 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.RegistryNameStatusInner; + +/** + * Type representing RegistryNameStatus. + */ +public interface RegistryNameStatus extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryPassword.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryPassword.java new file mode 100644 index 000000000000..78bb7fabd317 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryPassword.java @@ -0,0 +1,69 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The login password for the container registry. + */ +public class RegistryPassword { + /** + * The password name. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /** + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the password name. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the password name. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Get the password value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the password value. + * + * @param value the value value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUpdateParameters.java new file mode 100644 index 000000000000..dfedad679cae --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUpdateParameters.java @@ -0,0 +1,228 @@ +/** + * 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_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a container registry. + */ +@JsonFlatten +public class RegistryUpdateParameters { + /** + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The identity of the container registry. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The network rule set for a container registry. + */ + @JsonProperty(value = "properties.networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /** + * The policies for a container registry. + */ + @JsonProperty(value = "properties.policies") + private Policies policies; + + /** + * The encryption settings of container registry. + */ + @JsonProperty(value = "properties.encryption") + private EncryptionProperty encryption; + + /** + * Enable a single data endpoint per region for serving data. + */ + @JsonProperty(value = "properties.dataEndpointEnabled") + private Boolean dataEndpointEnabled; + + /** + * Get the tags for the container registry. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the container registry. + * + * @param tags the tags value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity of the container registry. + * + * @return the identity value + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity of the container registry. + * + * @param identity the identity value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the network rule set for a container registry. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the network rule set for a container registry. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the policies for a container registry. + * + * @return the policies value + */ + public Policies policies() { + return this.policies; + } + + /** + * Set the policies for a container registry. + * + * @param policies the policies value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withPolicies(Policies policies) { + this.policies = policies; + return this; + } + + /** + * Get the encryption settings of container registry. + * + * @return the encryption value + */ + public EncryptionProperty encryption() { + return this.encryption; + } + + /** + * Set the encryption settings of container registry. + * + * @param encryption the encryption value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withEncryption(EncryptionProperty encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value + */ + public Boolean dataEndpointEnabled() { + return this.dataEndpointEnabled; + } + + /** + * Set enable a single data endpoint per region for serving data. + * + * @param dataEndpointEnabled the dataEndpointEnabled value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withDataEndpointEnabled(Boolean dataEndpointEnabled) { + this.dataEndpointEnabled = dataEndpointEnabled; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsage.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsage.java new file mode 100644 index 000000000000..e3be9d190f93 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsage.java @@ -0,0 +1,121 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota usage for a container registry. + */ +public class RegistryUsage { + /** + * The name of the usage. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The limit of the usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /** + * The unit of measurement. Possible values include: 'Count', 'Bytes'. + */ + @JsonProperty(value = "unit") + private RegistryUsageUnit unit; + + /** + * Get the name of the usage. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the usage. + * + * @param name the name value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withName(String name) { + this.name = name; + return this; + } + + /** + * Get the limit of the usage. + * + * @return the limit value + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit of the usage. + * + * @param limit the limit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the usage. + * + * @param currentValue the currentValue value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @return the unit value + */ + public RegistryUsageUnit unit() { + return this.unit; + } + + /** + * Set the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @param unit the unit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withUnit(RegistryUsageUnit unit) { + this.unit = unit; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsageListResult.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsageListResult.java new file mode 100644 index 000000000000..9de276339a01 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsageListResult.java @@ -0,0 +1,26 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.RegistryUsageListResultInner; +import java.util.List; + +/** + * Type representing RegistryUsageListResult. + */ +public interface RegistryUsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsageUnit.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsageUnit.java new file mode 100644 index 000000000000..763aaac63250 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RegistryUsageUnit.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RegistryUsageUnit. + */ +public final class RegistryUsageUnit extends ExpandableStringEnum { + /** Static value Count for RegistryUsageUnit. */ + public static final RegistryUsageUnit COUNT = fromString("Count"); + + /** Static value Bytes for RegistryUsageUnit. */ + public static final RegistryUsageUnit BYTES = fromString("Bytes"); + + /** + * Creates or finds a RegistryUsageUnit from its string representation. + * @param name a name to look for + * @return the corresponding RegistryUsageUnit + */ + @JsonCreator + public static RegistryUsageUnit fromString(String name) { + return fromString(name, RegistryUsageUnit.class); + } + + /** + * @return known RegistryUsageUnit values + */ + public static Collection values() { + return values(RegistryUsageUnit.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Replication.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Replication.java new file mode 100644 index 000000000000..7f66d76b621d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Replication.java @@ -0,0 +1,145 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ReplicationInner; +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_12_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; + +/** + * Type representing Replication. + */ +public interface Replication extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the status value. + */ + Status1 status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Replication definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of Replication definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Replication definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the replication 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 replication 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 replication 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 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.WithTags { + } + } + /** + * The template for a Replication update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTags { + } + + /** + * Grouping of Replication update stages. + */ + interface UpdateStages { + /** + * The stage of the replication update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags of the resource + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ReplicationUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ReplicationUpdateParameters.java new file mode 100644 index 000000000000..4123b681257f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ReplicationUpdateParameters.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_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for updating a replication. + */ +public class ReplicationUpdateParameters { + /** + * The tags for the replication. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags for the replication. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the replication. + * + * @param tags the tags value to set + * @return the ReplicationUpdateParameters object itself. + */ + public ReplicationUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Replications.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Replications.java new file mode 100644 index 000000000000..85305406e24d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Replications.java @@ -0,0 +1,53 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ReplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Replications. + */ +public interface Replications extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String replicationName); + + /** + * Lists all the replications for the 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 replication from a 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String replicationName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Request.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Request.java new file mode 100644 index 000000000000..7842263ef9c5 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Request.java @@ -0,0 +1,150 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request that generated the event. + */ +public class Request { + /** + * The ID of the request that initiated the event. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The IP or hostname and possibly port of the client connection that + * initiated the event. This is the RemoteAddr from the standard http + * request. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The externally accessible hostname of the registry instance, as + * specified by the http host header on incoming requests. + */ + @JsonProperty(value = "host") + private String host; + + /** + * The request method that generated the event. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The user agent header of the request. + */ + @JsonProperty(value = "useragent") + private String useragent; + + /** + * Get the ID of the request that initiated the event. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the request that initiated the event. + * + * @param id the id value to set + * @return the Request object itself. + */ + public Request withId(String id) { + this.id = id; + return this; + } + + /** + * Get the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @param addr the addr value to set + * @return the Request object itself. + */ + public Request withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @param host the host value to set + * @return the Request object itself. + */ + public Request withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the request method that generated the event. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the request method that generated the event. + * + * @param method the method value to set + * @return the Request object itself. + */ + public Request withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the user agent header of the request. + * + * @return the useragent value + */ + public String useragent() { + return this.useragent; + } + + /** + * Set the user agent header of the request. + * + * @param useragent the useragent value to set + * @return the Request object itself. + */ + public Request withUseragent(String useragent) { + this.useragent = useragent; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ResourceIdentityType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ResourceIdentityType.java new file mode 100644 index 000000000000..87cc77baf802 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ResourceIdentityType.java @@ -0,0 +1,59 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ResourceIdentityType. + */ +public enum ResourceIdentityType { + /** Enum value SystemAssigned. */ + SYSTEM_ASSIGNED("SystemAssigned"), + + /** Enum value UserAssigned. */ + USER_ASSIGNED("UserAssigned"), + + /** Enum value SystemAssigned, UserAssigned. */ + SYSTEM_ASSIGNED_USER_ASSIGNED("SystemAssigned, UserAssigned"), + + /** Enum value None. */ + NONE("None"); + + /** The actual serialized value for a ResourceIdentityType instance. */ + private String value; + + ResourceIdentityType(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ResourceIdentityType instance. + * + * @param value the serialized value to parse. + * @return the parsed ResourceIdentityType object, or null if unable to parse. + */ + @JsonCreator + public static ResourceIdentityType fromString(String value) { + ResourceIdentityType[] items = ResourceIdentityType.values(); + for (ResourceIdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RetentionPolicy.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RetentionPolicy.java new file mode 100644 index 000000000000..51d3a9ead1c6 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RetentionPolicy.java @@ -0,0 +1,87 @@ +/** + * 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_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The retention policy for a container registry. + */ +public class RetentionPolicy { + /** + * The number of days to retain an untagged manifest after which it gets + * purged. + */ + @JsonProperty(value = "days") + private Integer days; + + /** + * The timestamp when the policy was last updated. + */ + @JsonProperty(value = "lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastUpdatedTime; + + /** + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the number of days to retain an untagged manifest after which it gets purged. + * + * @return the days value + */ + public Integer days() { + return this.days; + } + + /** + * Set the number of days to retain an untagged manifest after which it gets purged. + * + * @param days the days value to set + * @return the RetentionPolicy object itself. + */ + public RetentionPolicy withDays(Integer days) { + this.days = days; + return this; + } + + /** + * Get the timestamp when the policy was last updated. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Get the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the RetentionPolicy object itself. + */ + public RetentionPolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Run.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Run.java new file mode 100644 index 000000000000..ea5efb165518 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Run.java @@ -0,0 +1,169 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.RunInner; +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.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Run. + */ +public interface Run extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the agentConfiguration value. + */ + AgentProperties agentConfiguration(); + + /** + * @return the agentPoolName value. + */ + String agentPoolName(); + + /** + * @return the createTime value. + */ + DateTime createTime(); + + /** + * @return the customRegistries value. + */ + List customRegistries(); + + /** + * @return the finishTime value. + */ + DateTime finishTime(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the imageUpdateTrigger value. + */ + ImageUpdateTrigger imageUpdateTrigger(); + + /** + * @return the isArchiveEnabled value. + */ + Boolean isArchiveEnabled(); + + /** + * @return the lastUpdatedTime value. + */ + DateTime lastUpdatedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputImages value. + */ + List outputImages(); + + /** + * @return the platform value. + */ + PlatformProperties platform(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the runErrorMessage value. + */ + String runErrorMessage(); + + /** + * @return the runId value. + */ + String runId(); + + /** + * @return the runType value. + */ + RunType runType(); + + /** + * @return the sourceRegistryAuth value. + */ + String sourceRegistryAuth(); + + /** + * @return the sourceTrigger value. + */ + SourceTriggerDescriptor sourceTrigger(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + RunStatus status(); + + /** + * @return the task value. + */ + String task(); + + /** + * @return the timerTrigger value. + */ + TimerTriggerDescriptor timerTrigger(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the updateTriggerToken value. + */ + String updateTriggerToken(); + + /** + * The template for a Run update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithIsArchiveEnabled { + } + + /** + * Grouping of Run update stages. + */ + interface UpdateStages { + /** + * The stage of the run update allowing to specify IsArchiveEnabled. + */ + interface WithIsArchiveEnabled { + /** + * Specifies isArchiveEnabled. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not + * @return the next update stage + */ + Update withIsArchiveEnabled(Boolean isArchiveEnabled); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunFilter.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunFilter.java new file mode 100644 index 000000000000..8493895f9da9 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunFilter.java @@ -0,0 +1,259 @@ +/** + * 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_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that are enabled for Odata querying on runs. + */ +public class RunFilter { + /** + * The unique identifier for the run. + */ + @JsonProperty(value = "runId") + private String runId; + + /** + * The type of run. Possible values include: 'QuickBuild', 'QuickRun', + * 'AutoBuild', 'AutoRun'. + */ + @JsonProperty(value = "runType") + private RunType runType; + + /** + * The current status of the run. Possible values include: 'Queued', + * 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', + * 'Timeout'. + */ + @JsonProperty(value = "status") + private RunStatus status; + + /** + * The create time for a run. + */ + @JsonProperty(value = "createTime") + private DateTime createTime; + + /** + * The time the run finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The list of comma-separated image manifests that were generated from the + * run. This is applicable if the run is of + * build type. + */ + @JsonProperty(value = "outputImageManifests") + private String outputImageManifests; + + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * The name of the task that the run corresponds to. + */ + @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. + * + * @return the runId value + */ + public String runId() { + return this.runId; + } + + /** + * Set the unique identifier for the run. + * + * @param runId the runId value to set + * @return the RunFilter object itself. + */ + public RunFilter withRunId(String runId) { + this.runId = runId; + return this; + } + + /** + * Get the type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'. + * + * @return the runType value + */ + public RunType runType() { + return this.runType; + } + + /** + * Set the type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'. + * + * @param runType the runType value to set + * @return the RunFilter object itself. + */ + public RunFilter withRunType(RunType runType) { + this.runType = runType; + return this; + } + + /** + * Get the current status of the run. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @return the status value + */ + public RunStatus status() { + return this.status; + } + + /** + * Set the current status of the run. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @param status the status value to set + * @return the RunFilter object itself. + */ + public RunFilter withStatus(RunStatus status) { + this.status = status; + return this; + } + + /** + * Get the create time for a run. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the create time for a run. + * + * @param createTime the createTime value to set + * @return the RunFilter object itself. + */ + public RunFilter withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the time the run finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the time the run finished. + * + * @param finishTime the finishTime value to set + * @return the RunFilter object itself. + */ + public RunFilter withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the list of comma-separated image manifests that were generated from the run. This is applicable if the run is of + build type. + * + * @return the outputImageManifests value + */ + public String outputImageManifests() { + return this.outputImageManifests; + } + + /** + * Set the list of comma-separated image manifests that were generated from the run. This is applicable if the run is of + build type. + * + * @param outputImageManifests the outputImageManifests value to set + * @return the RunFilter object itself. + */ + public RunFilter withOutputImageManifests(String outputImageManifests) { + this.outputImageManifests = outputImageManifests; + return this; + } + + /** + * Get the value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the RunFilter object itself. + */ + public RunFilter withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the name of the task that the run corresponds to. + * + * @return the taskName value + */ + public String taskName() { + return this.taskName; + } + + /** + * Set the name of the task that the run corresponds to. + * + * @param taskName the taskName value to set + * @return the RunFilter object itself. + */ + public RunFilter withTaskName(String taskName) { + this.taskName = 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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunGetLogResult.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunGetLogResult.java new file mode 100644 index 000000000000..7095aed95485 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunGetLogResult.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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.RunGetLogResultInner; + +/** + * Type representing RunGetLogResult. + */ +public interface RunGetLogResult extends HasInner, HasManager { + /** + * @return the logLink value. + */ + String logLink(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunRequest.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunRequest.java new file mode 100644 index 000000000000..0d7c4adfc4e8 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunRequest.java @@ -0,0 +1,81 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The request parameters for scheduling a run. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = RunRequest.class) +@JsonTypeName("RunRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "DockerBuildRequest", value = DockerBuildRequest.class), + @JsonSubTypes.Type(name = "FileTaskRunRequest", value = FileTaskRunRequest.class), + @JsonSubTypes.Type(name = "TaskRunRequest", value = TaskRunRequest.class), + @JsonSubTypes.Type(name = "EncodedTaskRunRequest", value = EncodedTaskRunRequest.class) +}) +public class RunRequest { + /** + * The value that indicates whether archiving is enabled for the run or + * not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * The dedicated agent pool for the run. + */ + @JsonProperty(value = "agentPoolName") + private String agentPoolName; + + /** + * Get the value that indicates whether archiving is enabled for the run or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled for the run or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the RunRequest object itself. + */ + public RunRequest withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = 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; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunStatus.java new file mode 100644 index 000000000000..8400b42b1465 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunStatus.java @@ -0,0 +1,59 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RunStatus. + */ +public final class RunStatus extends ExpandableStringEnum { + /** Static value Queued for RunStatus. */ + public static final RunStatus QUEUED = fromString("Queued"); + + /** Static value Started for RunStatus. */ + public static final RunStatus STARTED = fromString("Started"); + + /** Static value Running for RunStatus. */ + public static final RunStatus RUNNING = fromString("Running"); + + /** Static value Succeeded for RunStatus. */ + public static final RunStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for RunStatus. */ + public static final RunStatus FAILED = fromString("Failed"); + + /** Static value Canceled for RunStatus. */ + public static final RunStatus CANCELED = fromString("Canceled"); + + /** Static value Error for RunStatus. */ + public static final RunStatus ERROR = fromString("Error"); + + /** Static value Timeout for RunStatus. */ + public static final RunStatus TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a RunStatus from its string representation. + * @param name a name to look for + * @return the corresponding RunStatus + */ + @JsonCreator + public static RunStatus fromString(String name) { + return fromString(name, RunStatus.class); + } + + /** + * @return known RunStatus values + */ + public static Collection values() { + return values(RunStatus.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunType.java new file mode 100644 index 000000000000..4ad7d4845a8d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunType.java @@ -0,0 +1,47 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RunType. + */ +public final class RunType extends ExpandableStringEnum { + /** Static value QuickBuild for RunType. */ + public static final RunType QUICK_BUILD = fromString("QuickBuild"); + + /** Static value QuickRun for RunType. */ + public static final RunType QUICK_RUN = fromString("QuickRun"); + + /** Static value AutoBuild for RunType. */ + public static final RunType AUTO_BUILD = fromString("AutoBuild"); + + /** Static value AutoRun for RunType. */ + public static final RunType AUTO_RUN = fromString("AutoRun"); + + /** + * Creates or finds a RunType from its string representation. + * @param name a name to look for + * @return the corresponding RunType + */ + @JsonCreator + public static RunType fromString(String name) { + return fromString(name, RunType.class); + } + + /** + * @return known RunType values + */ + public static Collection values() { + return values(RunType.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunUpdateParameters.java new file mode 100644 index 000000000000..34fa8c2eff35 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/RunUpdateParameters.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The set of run properties that can be updated. + */ +public class RunUpdateParameters { + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * Get the value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the RunUpdateParameters object itself. + */ + public RunUpdateParameters withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Runs.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Runs.java new file mode 100644 index 000000000000..5214b2c831d2 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Runs.java @@ -0,0 +1,63 @@ +/** + * 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_12_01_preview; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.RunsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Runs. + */ +public interface Runs extends HasInner { + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getLogSasUrlAsync(String resourceGroupName, String registryName, String runId); + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable cancelAsync(String resourceGroupName, String registryName, String runId); + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String runId); + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMap.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMap.java new file mode 100644 index 000000000000..6cf7b5bafe95 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMap.java @@ -0,0 +1,167 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ScopeMapInner; +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_12_01_preview.implementation.ContainerRegistryManager; +import java.util.List; +import org.joda.time.DateTime; + +/** + * Type representing ScopeMap. + */ +public interface ScopeMap extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the description value. + */ + String description(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the scopeMapType value. + */ + String scopeMapType(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the ScopeMap definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithActions, DefinitionStages.WithCreate { + } + + /** + * Grouping of ScopeMap definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a ScopeMap definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the scopemap 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 + */ + WithActions withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the scopemap definition allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + * @param actions The list of scoped permissions for registry artifacts. + E.g. repositories/repository-name/content/read, + repositories/repository-name/metadata/write + * @return the next definition stage + */ + WithCreate withActions(List actions); + } + + /** + * The stage of the scopemap definition allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The user friendly description of the scope map + * @return the next definition stage + */ + WithCreate withDescription(String description); + } + + /** + * 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.WithDescription { + } + } + /** + * The template for a ScopeMap update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithActions, UpdateStages.WithDescription { + } + + /** + * Grouping of ScopeMap update stages. + */ + interface UpdateStages { + /** + * The stage of the scopemap update allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + * @param actions The list of scope permissions for registry artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete + * @return the next update stage + */ + Update withActions(List actions); + } + + /** + * The stage of the scopemap update allowing to specify Description. + */ + interface WithDescription { + /** + * Specifies description. + * @param description The user friendly description of the scope map + * @return the next update stage + */ + Update withDescription(String description); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMapUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMapUpdateParameters.java new file mode 100644 index 000000000000..694381a566e5 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMapUpdateParameters.java @@ -0,0 +1,78 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The properties for updating the scope map. + */ +@JsonFlatten +public class ScopeMapUpdateParameters { + /** + * The user friendly description of the scope map. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The list of scope permissions for registry artifacts. + * E.g. repositories/repository-name/pull, + * repositories/repository-name/delete. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * Get the user friendly description of the scope map. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the user friendly description of the scope map. + * + * @param description the description value to set + * @return the ScopeMapUpdateParameters object itself. + */ + public ScopeMapUpdateParameters withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the list of scope permissions for registry artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of scope permissions for registry artifacts. + E.g. repositories/repository-name/pull, + repositories/repository-name/delete. + * + * @param actions the actions value to set + * @return the ScopeMapUpdateParameters object itself. + */ + public ScopeMapUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMaps.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMaps.java new file mode 100644 index 000000000000..1e3dd9d70fe6 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/ScopeMaps.java @@ -0,0 +1,53 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ScopeMapsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing ScopeMaps. + */ +public interface ScopeMaps extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String scopeMapName); + + /** + * Lists all the scope maps for the 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 scope map from a 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 scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String scopeMapName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SecretObject.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SecretObject.java new file mode 100644 index 000000000000..d81d4ba70e6a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SecretObject.java @@ -0,0 +1,80 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the properties of a secret object value. + */ +public class SecretObject { + /** + * The value of the secret. The format of this value will be determined + * based on the type of the secret object. If the type is Opaque, the value + * will be + * used as is without any modification. + */ + @JsonProperty(value = "value") + private String value; + + /** + * The type of the secret object which determines how the value of the + * secret object has to be + * interpreted. Possible values include: 'Opaque', 'Vaultsecret'. + */ + @JsonProperty(value = "type") + private SecretObjectType type; + + /** + * Get the value of the secret. The format of this value will be determined + based on the type of the secret object. If the type is Opaque, the value will be + used as is without any modification. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the secret. The format of this value will be determined + based on the type of the secret object. If the type is Opaque, the value will be + used as is without any modification. + * + * @param value the value value to set + * @return the SecretObject object itself. + */ + public SecretObject withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the type of the secret object which determines how the value of the secret object has to be + interpreted. Possible values include: 'Opaque', 'Vaultsecret'. + * + * @return the type value + */ + public SecretObjectType type() { + return this.type; + } + + /** + * Set the type of the secret object which determines how the value of the secret object has to be + interpreted. Possible values include: 'Opaque', 'Vaultsecret'. + * + * @param type the type value to set + * @return the SecretObject object itself. + */ + public SecretObject withType(SecretObjectType type) { + this.type = type; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SecretObjectType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SecretObjectType.java new file mode 100644 index 000000000000..31f778497151 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SecretObjectType.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SecretObjectType. + */ +public final class SecretObjectType extends ExpandableStringEnum { + /** Static value Opaque for SecretObjectType. */ + public static final SecretObjectType OPAQUE = fromString("Opaque"); + + /** Static value Vaultsecret for SecretObjectType. */ + public static final SecretObjectType VAULTSECRET = fromString("Vaultsecret"); + + /** + * Creates or finds a SecretObjectType from its string representation. + * @param name a name to look for + * @return the corresponding SecretObjectType + */ + @JsonCreator + public static SecretObjectType fromString(String name) { + return fromString(name, SecretObjectType.class); + } + + /** + * @return known SecretObjectType values + */ + public static Collection values() { + return values(SecretObjectType.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SetValue.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SetValue.java new file mode 100644 index 000000000000..264bb42b0323 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SetValue.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a overridable value that can be passed to a task template. + */ +public class SetValue { + /** + * The name of the overridable value. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The overridable value. + */ + @JsonProperty(value = "value", required = true) + private String value; + + /** + * Flag to indicate whether the value represents a secret or not. + */ + @JsonProperty(value = "isSecret") + private Boolean isSecret; + + /** + * Get the name of the overridable value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the overridable value. + * + * @param name the name value to set + * @return the SetValue object itself. + */ + public SetValue withName(String name) { + this.name = name; + return this; + } + + /** + * Get the overridable value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the overridable value. + * + * @param value the value value to set + * @return the SetValue object itself. + */ + public SetValue withValue(String value) { + this.value = value; + return this; + } + + /** + * Get flag to indicate whether the value represents a secret or not. + * + * @return the isSecret value + */ + public Boolean isSecret() { + return this.isSecret; + } + + /** + * Set flag to indicate whether the value represents a secret or not. + * + * @param isSecret the isSecret value to set + * @return the SetValue object itself. + */ + public SetValue withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Sku.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Sku.java new file mode 100644 index 000000000000..c96dba10261b --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Sku.java @@ -0,0 +1,60 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of a container registry. + */ +public class Sku { + /** + * The SKU name of the container registry. Required for registry creation. + * Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The SKU tier based on the SKU name. Possible values include: 'Classic', + * 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set the SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the SKU tier based on the SKU name. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SkuName.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SkuName.java new file mode 100644 index 000000000000..74e6314bda5b --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SkuName.java @@ -0,0 +1,47 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Classic for SkuName. */ + public static final SkuName CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** Static value Premium for SkuName. */ + public static final SkuName PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SkuTier.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SkuTier.java new file mode 100644 index 000000000000..d2e144674d95 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SkuTier.java @@ -0,0 +1,47 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Classic for SkuTier. */ + public static final SkuTier CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for SkuTier. */ + public static final SkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Source.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Source.java new file mode 100644 index 000000000000..19a8d74b0c17 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Source.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The registry node that generated the event. Put differently, while the actor + * initiates the event, the source generates it. + */ +public class Source { + /** + * The IP or hostname and the port of the registry node that generated the + * event. Generally, this will be resolved by os.Hostname() along with the + * running port. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The running instance of an application. Changes after each restart. + */ + @JsonProperty(value = "instanceID") + private String instanceID; + + /** + * Get the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @param addr the addr value to set + * @return the Source object itself. + */ + public Source withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the running instance of an application. Changes after each restart. + * + * @return the instanceID value + */ + public String instanceID() { + return this.instanceID; + } + + /** + * Set the running instance of an application. Changes after each restart. + * + * @param instanceID the instanceID value to set + * @return the Source object itself. + */ + public Source withInstanceID(String instanceID) { + this.instanceID = instanceID; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceControlType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceControlType.java new file mode 100644 index 000000000000..6d6c1d106940 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceControlType.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SourceControlType. + */ +public final class SourceControlType extends ExpandableStringEnum { + /** Static value Github for SourceControlType. */ + public static final SourceControlType GITHUB = fromString("Github"); + + /** Static value VisualStudioTeamService for SourceControlType. */ + public static final SourceControlType VISUAL_STUDIO_TEAM_SERVICE = fromString("VisualStudioTeamService"); + + /** + * Creates or finds a SourceControlType from its string representation. + * @param name a name to look for + * @return the corresponding SourceControlType + */ + @JsonCreator + public static SourceControlType fromString(String name) { + return fromString(name, SourceControlType.class); + } + + /** + * @return known SourceControlType values + */ + public static Collection values() { + return values(SourceControlType.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceProperties.java new file mode 100644 index 000000000000..126736a2a3ef --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceProperties.java @@ -0,0 +1,126 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the source code repository. + */ +public class SourceProperties { + /** + * The type of source control service. Possible values include: 'Github', + * 'VisualStudioTeamService'. + */ + @JsonProperty(value = "sourceControlType", required = true) + private SourceControlType sourceControlType; + + /** + * The full URL to the source code repository. + */ + @JsonProperty(value = "repositoryUrl", required = true) + private String repositoryUrl; + + /** + * The branch name of the source code. + */ + @JsonProperty(value = "branch") + private String branch; + + /** + * The authorization properties for accessing the source code repository + * and to set up + * webhooks for notifications. + */ + @JsonProperty(value = "sourceControlAuthProperties") + private AuthInfo sourceControlAuthProperties; + + /** + * Get the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @return the sourceControlType value + */ + public SourceControlType sourceControlType() { + return this.sourceControlType; + } + + /** + * Set the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @param sourceControlType the sourceControlType value to set + * @return the SourceProperties object itself. + */ + public SourceProperties withSourceControlType(SourceControlType sourceControlType) { + this.sourceControlType = sourceControlType; + return this; + } + + /** + * Get the full URL to the source code repository. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the full URL to the source code repository. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceProperties object itself. + */ + public SourceProperties withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch name of the source code. + * + * @return the branch value + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch name of the source code. + * + * @param branch the branch value to set + * @return the SourceProperties object itself. + */ + public SourceProperties withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the authorization properties for accessing the source code repository and to set up + webhooks for notifications. + * + * @return the sourceControlAuthProperties value + */ + public AuthInfo sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the authorization properties for accessing the source code repository and to set up + webhooks for notifications. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set + * @return the SourceProperties object itself. + */ + public SourceProperties withSourceControlAuthProperties(AuthInfo sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceRegistryCredentials.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceRegistryCredentials.java new file mode 100644 index 000000000000..1456ee210a2e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceRegistryCredentials.java @@ -0,0 +1,52 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Describes the credential parameters for accessing the source registry. + */ +public class SourceRegistryCredentials { + /** + * The authentication mode which determines the source registry login + * scope. The credentials for the source registry + * will be generated using the given scope. These credentials will be used + * to login to + * the source registry during the run. Possible values include: 'None', + * 'Default'. + */ + @JsonProperty(value = "loginMode") + private SourceRegistryLoginMode loginMode; + + /** + * Get the authentication mode which determines the source registry login scope. The credentials for the source registry + will be generated using the given scope. These credentials will be used to login to + the source registry during the run. Possible values include: 'None', 'Default'. + * + * @return the loginMode value + */ + public SourceRegistryLoginMode loginMode() { + return this.loginMode; + } + + /** + * Set the authentication mode which determines the source registry login scope. The credentials for the source registry + will be generated using the given scope. These credentials will be used to login to + the source registry during the run. Possible values include: 'None', 'Default'. + * + * @param loginMode the loginMode value to set + * @return the SourceRegistryCredentials object itself. + */ + public SourceRegistryCredentials withLoginMode(SourceRegistryLoginMode loginMode) { + this.loginMode = loginMode; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceRegistryLoginMode.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceRegistryLoginMode.java new file mode 100644 index 000000000000..4a6997a9d6a7 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceRegistryLoginMode.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SourceRegistryLoginMode. + */ +public final class SourceRegistryLoginMode extends ExpandableStringEnum { + /** Static value None for SourceRegistryLoginMode. */ + public static final SourceRegistryLoginMode NONE = fromString("None"); + + /** Static value Default for SourceRegistryLoginMode. */ + public static final SourceRegistryLoginMode DEFAULT = fromString("Default"); + + /** + * Creates or finds a SourceRegistryLoginMode from its string representation. + * @param name a name to look for + * @return the corresponding SourceRegistryLoginMode + */ + @JsonCreator + public static SourceRegistryLoginMode fromString(String name) { + return fromString(name, SourceRegistryLoginMode.class); + } + + /** + * @return known SourceRegistryLoginMode values + */ + public static Collection values() { + return values(SourceRegistryLoginMode.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTrigger.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTrigger.java new file mode 100644 index 000000000000..a48f4bf96c7e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTrigger.java @@ -0,0 +1,123 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a source based trigger. + */ +public class SourceTrigger { + /** + * The properties that describes the source(code) for the task. + */ + @JsonProperty(value = "sourceRepository", required = true) + private SourceProperties sourceRepository; + + /** + * The source event corresponding to the trigger. + */ + @JsonProperty(value = "sourceTriggerEvents", required = true) + private List sourceTriggerEvents; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the properties that describes the source(code) for the task. + * + * @return the sourceRepository value + */ + public SourceProperties sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the properties that describes the source(code) for the task. + * + * @param sourceRepository the sourceRepository value to set + * @return the SourceTrigger object itself. + */ + public SourceTrigger withSourceRepository(SourceProperties sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the source event corresponding to the trigger. + * + * @return the sourceTriggerEvents value + */ + public List sourceTriggerEvents() { + return this.sourceTriggerEvents; + } + + /** + * Set the source event corresponding to the trigger. + * + * @param sourceTriggerEvents the sourceTriggerEvents value to set + * @return the SourceTrigger object itself. + */ + public SourceTrigger withSourceTriggerEvents(List sourceTriggerEvents) { + this.sourceTriggerEvents = sourceTriggerEvents; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the SourceTrigger object itself. + */ + public SourceTrigger withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the SourceTrigger object itself. + */ + public SourceTrigger withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerDescriptor.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerDescriptor.java new file mode 100644 index 000000000000..202564247415 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerDescriptor.java @@ -0,0 +1,199 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The source trigger that caused a run. + */ +public class SourceTriggerDescriptor { + /** + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The event type of the trigger. + */ + @JsonProperty(value = "eventType") + private String eventType; + + /** + * The unique ID that identifies a commit. + */ + @JsonProperty(value = "commitId") + private String commitId; + + /** + * The unique ID that identifies pull request. + */ + @JsonProperty(value = "pullRequestId") + private String pullRequestId; + + /** + * The repository URL. + */ + @JsonProperty(value = "repositoryUrl") + private String repositoryUrl; + + /** + * The branch name in the repository. + */ + @JsonProperty(value = "branchName") + private String branchName; + + /** + * The source control provider type. + */ + @JsonProperty(value = "providerType") + private String providerType; + + /** + * Get the unique ID of the trigger. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the unique ID of the trigger. + * + * @param id the id value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withId(String id) { + this.id = id; + return this; + } + + /** + * Get the event type of the trigger. + * + * @return the eventType value + */ + public String eventType() { + return this.eventType; + } + + /** + * Set the event type of the trigger. + * + * @param eventType the eventType value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withEventType(String eventType) { + this.eventType = eventType; + return this; + } + + /** + * Get the unique ID that identifies a commit. + * + * @return the commitId value + */ + public String commitId() { + return this.commitId; + } + + /** + * Set the unique ID that identifies a commit. + * + * @param commitId the commitId value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withCommitId(String commitId) { + this.commitId = commitId; + return this; + } + + /** + * Get the unique ID that identifies pull request. + * + * @return the pullRequestId value + */ + public String pullRequestId() { + return this.pullRequestId; + } + + /** + * Set the unique ID that identifies pull request. + * + * @param pullRequestId the pullRequestId value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withPullRequestId(String pullRequestId) { + this.pullRequestId = pullRequestId; + return this; + } + + /** + * Get the repository URL. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repository URL. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch name in the repository. + * + * @return the branchName value + */ + public String branchName() { + return this.branchName; + } + + /** + * Set the branch name in the repository. + * + * @param branchName the branchName value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withBranchName(String branchName) { + this.branchName = branchName; + return this; + } + + /** + * Get the source control provider type. + * + * @return the providerType value + */ + public String providerType() { + return this.providerType; + } + + /** + * Set the source control provider type. + * + * @param providerType the providerType value to set + * @return the SourceTriggerDescriptor object itself. + */ + public SourceTriggerDescriptor withProviderType(String providerType) { + this.providerType = providerType; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerEvent.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerEvent.java new file mode 100644 index 000000000000..a8465fc8628f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerEvent.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SourceTriggerEvent. + */ +public final class SourceTriggerEvent extends ExpandableStringEnum { + /** Static value commit for SourceTriggerEvent. */ + public static final SourceTriggerEvent COMMIT = fromString("commit"); + + /** Static value pullrequest for SourceTriggerEvent. */ + public static final SourceTriggerEvent PULLREQUEST = fromString("pullrequest"); + + /** + * Creates or finds a SourceTriggerEvent from its string representation. + * @param name a name to look for + * @return the corresponding SourceTriggerEvent + */ + @JsonCreator + public static SourceTriggerEvent fromString(String name) { + return fromString(name, SourceTriggerEvent.class); + } + + /** + * @return known SourceTriggerEvent values + */ + public static Collection values() { + return values(SourceTriggerEvent.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerUpdateParameters.java new file mode 100644 index 000000000000..da8a87b45fc4 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceTriggerUpdateParameters.java @@ -0,0 +1,123 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating a source based trigger. + */ +public class SourceTriggerUpdateParameters { + /** + * The properties that describes the source(code) for the task. + */ + @JsonProperty(value = "sourceRepository") + private SourceUpdateParameters sourceRepository; + + /** + * The source event corresponding to the trigger. + */ + @JsonProperty(value = "sourceTriggerEvents") + private List sourceTriggerEvents; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the properties that describes the source(code) for the task. + * + * @return the sourceRepository value + */ + public SourceUpdateParameters sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the properties that describes the source(code) for the task. + * + * @param sourceRepository the sourceRepository value to set + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withSourceRepository(SourceUpdateParameters sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the source event corresponding to the trigger. + * + * @return the sourceTriggerEvents value + */ + public List sourceTriggerEvents() { + return this.sourceTriggerEvents; + } + + /** + * Set the source event corresponding to the trigger. + * + * @param sourceTriggerEvents the sourceTriggerEvents value to set + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withSourceTriggerEvents(List sourceTriggerEvents) { + this.sourceTriggerEvents = sourceTriggerEvents; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the SourceTriggerUpdateParameters object itself. + */ + public SourceTriggerUpdateParameters withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceUpdateParameters.java new file mode 100644 index 000000000000..515b749f665f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceUpdateParameters.java @@ -0,0 +1,126 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating the source code repository. + */ +public class SourceUpdateParameters { + /** + * The type of source control service. Possible values include: 'Github', + * 'VisualStudioTeamService'. + */ + @JsonProperty(value = "sourceControlType") + private SourceControlType sourceControlType; + + /** + * The full URL to the source code repository. + */ + @JsonProperty(value = "repositoryUrl") + private String repositoryUrl; + + /** + * The branch name of the source code. + */ + @JsonProperty(value = "branch") + private String branch; + + /** + * The authorization properties for accessing the source code repository + * and to set up + * webhooks for notifications. + */ + @JsonProperty(value = "sourceControlAuthProperties") + private AuthInfoUpdateParameters sourceControlAuthProperties; + + /** + * Get the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @return the sourceControlType value + */ + public SourceControlType sourceControlType() { + return this.sourceControlType; + } + + /** + * Set the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @param sourceControlType the sourceControlType value to set + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withSourceControlType(SourceControlType sourceControlType) { + this.sourceControlType = sourceControlType; + return this; + } + + /** + * Get the full URL to the source code repository. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the full URL to the source code repository. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch name of the source code. + * + * @return the branch value + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch name of the source code. + * + * @param branch the branch value to set + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the authorization properties for accessing the source code repository and to set up + webhooks for notifications. + * + * @return the sourceControlAuthProperties value + */ + public AuthInfoUpdateParameters sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the authorization properties for accessing the source code repository and to set up + webhooks for notifications. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set + * @return the SourceUpdateParameters object itself. + */ + public SourceUpdateParameters withSourceControlAuthProperties(AuthInfoUpdateParameters sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceUploadDefinition.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceUploadDefinition.java new file mode 100644 index 000000000000..e51257c1ada8 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/SourceUploadDefinition.java @@ -0,0 +1,30 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.SourceUploadDefinitionInner; + +/** + * Type representing SourceUploadDefinition. + */ +public interface SourceUploadDefinition extends HasInner, HasManager { + /** + * @return the relativePath value. + */ + String relativePath(); + + /** + * @return the uploadUrl value. + */ + String uploadUrl(); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Status.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Status.java new file mode 100644 index 000000000000..ef5d581fe5a3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Status.java @@ -0,0 +1,47 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Status. + */ +public final class Status extends ExpandableStringEnum { + /** Static value Approved for Status. */ + public static final Status APPROVED = fromString("Approved"); + + /** Static value Pending for Status. */ + public static final Status PENDING = fromString("Pending"); + + /** Static value Rejected for Status. */ + public static final Status REJECTED = fromString("Rejected"); + + /** Static value Disconnected for Status. */ + public static final Status DISCONNECTED = fromString("Disconnected"); + + /** + * Creates or finds a Status from its string representation. + * @param name a name to look for + * @return the corresponding Status + */ + @JsonCreator + public static Status fromString(String name) { + return fromString(name, Status.class); + } + + /** + * @return known Status values + */ + public static Collection values() { + return values(Status.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Status1.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Status1.java new file mode 100644 index 000000000000..9177764c9113 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Status1.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_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The status of an Azure resource at the time the operation was called. + */ +public class Status1 { + /** + * The short label for the status. + */ + @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) + private String displayStatus; + + /** + * The detailed message for the status, including alerts and error + * messages. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The timestamp when the status was changed to the current value. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Get the short label for the status. + * + * @return the displayStatus value + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the detailed message for the status, including alerts and error messages. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the timestamp when the status was changed to the current value. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/StorageAccountProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/StorageAccountProperties.java new file mode 100644 index 000000000000..38c78d3afa22 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/StorageAccountProperties.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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a storage account for a container registry. Only + * applicable to Classic SKU. + */ +public class StorageAccountProperties { + /** + * The resource ID of the storage account. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the resource ID of the storage account. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the storage account. + * + * @param id the id value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Target.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Target.java new file mode 100644 index 000000000000..41345d21fdde --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Target.java @@ -0,0 +1,252 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The target of the event. + */ +public class Target { + /** + * The MIME type of the referenced object. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /** + * The number of bytes of the content. Same as Length field. + */ + @JsonProperty(value = "size") + private Long size; + + /** + * The digest of the content, as defined by the Registry V2 HTTP API + * Specification. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * The number of bytes of the content. Same as Size field. + */ + @JsonProperty(value = "length") + private Long length; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The direct URL to the content. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * The name of the artifact. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The version of the artifact. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the MIME type of the referenced object. + * + * @return the mediaType value + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the MIME type of the referenced object. + * + * @param mediaType the mediaType value to set + * @return the Target object itself. + */ + public Target withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the number of bytes of the content. Same as Length field. + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Set the number of bytes of the content. Same as Length field. + * + * @param size the size value to set + * @return the Target object itself. + */ + public Target withSize(Long size) { + this.size = size; + return this; + } + + /** + * Get the digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @param digest the digest value to set + * @return the Target object itself. + */ + public Target withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Get the number of bytes of the content. Same as Size field. + * + * @return the length value + */ + public Long length() { + return this.length; + } + + /** + * Set the number of bytes of the content. Same as Size field. + * + * @param length the length value to set + * @return the Target object itself. + */ + public Target withLength(Long length) { + this.length = length; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the Target object itself. + */ + public Target withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the direct URL to the content. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the direct URL to the content. + * + * @param url the url value to set + * @return the Target object itself. + */ + public Target withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the Target object itself. + */ + public Target withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the name of the artifact. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the artifact. + * + * @param name the name value to set + * @return the Target object itself. + */ + public Target withName(String name) { + this.name = name; + return this; + } + + /** + * Get the version of the artifact. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the version of the artifact. + * + * @param version the version value to set + * @return the Target object itself. + */ + public Target withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Task.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Task.java new file mode 100644 index 000000000000..4fc87bb5d1c3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Task.java @@ -0,0 +1,407 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.TaskInner; +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_12_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; +import org.joda.time.DateTime; + +/** + * Type representing Task. + */ +public interface Task extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the agentConfiguration value. + */ + AgentProperties agentConfiguration(); + + /** + * @return the agentPoolName value. + */ + String agentPoolName(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the credentials value. + */ + Credentials credentials(); + + /** + * @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 platform value. + */ + PlatformProperties platform(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the status value. + */ + TaskStatus status(); + + /** + * @return the step value. + */ + TaskStepProperties step(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the timeout value. + */ + Integer timeout(); + + /** + * @return the trigger value. + */ + TriggerProperties trigger(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Task definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithPlatform, DefinitionStages.WithStep, DefinitionStages.WithCreate { + } + + /** + * Grouping of Task definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Task definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the task 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 task 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 + */ + 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); + } + + /** + * The stage of the task definition allowing to specify AgentConfiguration. + */ + interface WithAgentConfiguration { + /** + * Specifies agentConfiguration. + * @param agentConfiguration The machine configuration of the run agent + * @return the next definition stage + */ + 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. + */ + interface WithCredentials { + /** + * Specifies credentials. + * @param credentials The properties that describes a set of credentials that will be used when this run is invoked + * @return the next definition stage + */ + WithCreate withCredentials(Credentials credentials); + } + + /** + * The stage of the task 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 task definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The current status of task. Possible values include: 'Disabled', 'Enabled' + * @return the next definition stage + */ + WithCreate withStatus(TaskStatus status); + } + + /** + * The stage of the task 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 task definition allowing to specify Timeout. + */ + interface WithTimeout { + /** + * Specifies timeout. + * @param timeout Run timeout in seconds + * @return the next definition stage + */ + WithCreate withTimeout(Integer timeout); + } + + /** + * The stage of the task definition allowing to specify Trigger. + */ + interface WithTrigger { + /** + * Specifies trigger. + * @param trigger The properties that describe all triggers for the task + * @return the next definition stage + */ + WithCreate withTrigger(TriggerProperties trigger); + } + + /** + * 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.WithAgentConfiguration, DefinitionStages.WithAgentPoolName, DefinitionStages.WithCredentials, DefinitionStages.WithIdentity, DefinitionStages.WithStatus, 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.WithAgentPoolName, UpdateStages.WithCredentials, UpdateStages.WithIdentity, UpdateStages.WithPlatform, UpdateStages.WithStatus, UpdateStages.WithStep, UpdateStages.WithTags, UpdateStages.WithTimeout, UpdateStages.WithTrigger { + } + + /** + * Grouping of Task update stages. + */ + interface UpdateStages { + /** + * The stage of the task update allowing to specify AgentConfiguration. + */ + interface WithAgentConfiguration { + /** + * Specifies agentConfiguration. + * @param agentConfiguration The machine configuration of the run agent + * @return the next update stage + */ + 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. + */ + interface WithCredentials { + /** + * Specifies credentials. + * @param credentials The parameters that describes a set of credentials that will be used when this run is invoked + * @return the next update stage + */ + Update withCredentials(Credentials credentials); + } + + /** + * The stage of the task 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 task update allowing to specify Platform. + */ + interface WithPlatform { + /** + * Specifies platform. + * @param platform The platform properties against which the run has to happen + * @return the next update stage + */ + Update withPlatform(PlatformUpdateParameters platform); + } + + /** + * The stage of the task update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The current status of task. Possible values include: 'Disabled', 'Enabled' + * @return the next update stage + */ + Update withStatus(TaskStatus status); + } + + /** + * The stage of the task update allowing to specify Step. + */ + interface WithStep { + /** + * Specifies step. + * @param step The properties for updating a task step + * @return the next update stage + */ + Update withStep(TaskStepUpdateParameters step); + } + + /** + * The stage of the task update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The ARM resource tags + * @return the next update stage + */ + Update withTags(Map tags); + } + + /** + * The stage of the task update allowing to specify Timeout. + */ + interface WithTimeout { + /** + * Specifies timeout. + * @param timeout Run timeout in seconds + * @return the next update stage + */ + Update withTimeout(Integer timeout); + } + + /** + * The stage of the task update allowing to specify Trigger. + */ + interface WithTrigger { + /** + * Specifies trigger. + * @param trigger The properties for updating trigger properties + * @return the next update stage + */ + Update withTrigger(TriggerUpdateParameters trigger); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRun.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRun.java new file mode 100644 index 000000000000..b81a993bb6f8 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRun.java @@ -0,0 +1,232 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_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 tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the TaskRun definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, 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 + */ + WithLocation withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the taskrun 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 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 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 taskrun 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 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.WithRunRequest, DefinitionStages.WithTags { + } + } + /** + * The template for a TaskRun update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithForceUpdateTag, UpdateStages.WithIdentity, 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 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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRunRequest.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRunRequest.java new file mode 100644 index 000000000000..9bf70336c8e4 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRunRequest.java @@ -0,0 +1,73 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The parameters for a task run request. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = TaskRunRequest.class) +@JsonTypeName("TaskRunRequest") +public class TaskRunRequest extends RunRequest { + /** + * The resource ID of task against which run has to be queued. + */ + @JsonProperty(value = "taskId", required = true) + private String taskId; + + /** + * Set of overridable parameters that can be passed when running a Task. + */ + @JsonProperty(value = "overrideTaskStepProperties") + private OverrideTaskStepProperties overrideTaskStepProperties; + + /** + * Get the resource ID of task against which run has to be queued. + * + * @return the taskId value + */ + public String taskId() { + return this.taskId; + } + + /** + * Set the resource ID of task against which run has to be queued. + * + * @param taskId the taskId value to set + * @return the TaskRunRequest object itself. + */ + public TaskRunRequest withTaskId(String taskId) { + this.taskId = taskId; + return this; + } + + /** + * Get set of overridable parameters that can be passed when running a Task. + * + * @return the overrideTaskStepProperties value + */ + public OverrideTaskStepProperties overrideTaskStepProperties() { + return this.overrideTaskStepProperties; + } + + /** + * Set set of overridable parameters that can be passed when running a Task. + * + * @param overrideTaskStepProperties the overrideTaskStepProperties value to set + * @return the TaskRunRequest object itself. + */ + public TaskRunRequest withOverrideTaskStepProperties(OverrideTaskStepProperties overrideTaskStepProperties) { + this.overrideTaskStepProperties = overrideTaskStepProperties; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRunUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRunUpdateParameters.java new file mode 100644 index 000000000000..f92b5d29d262 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRunUpdateParameters.java @@ -0,0 +1,125 @@ +/** + * 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_12_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 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 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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRuns.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskRuns.java new file mode 100644 index 000000000000..270c1bb1101c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_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 run request name. + * @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 run request name. + * @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 task run name. + * @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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStatus.java new file mode 100644 index 000000000000..7d55de0ca95c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStatus.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TaskStatus. + */ +public final class TaskStatus extends ExpandableStringEnum { + /** Static value Disabled for TaskStatus. */ + public static final TaskStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for TaskStatus. */ + public static final TaskStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a TaskStatus from its string representation. + * @param name a name to look for + * @return the corresponding TaskStatus + */ + @JsonCreator + public static TaskStatus fromString(String name) { + return fromString(name, TaskStatus.class); + } + + /** + * @return known TaskStatus values + */ + public static Collection values() { + return values(TaskStatus.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStepProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStepProperties.java new file mode 100644 index 000000000000..e865e2dcea1c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStepProperties.java @@ -0,0 +1,96 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base properties for any task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = TaskStepProperties.class) +@JsonTypeName("TaskStepProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Docker", value = DockerBuildStep.class), + @JsonSubTypes.Type(name = "FileTask", value = FileTaskStep.class), + @JsonSubTypes.Type(name = "EncodedTask", value = EncodedTaskStep.class) +}) +public class TaskStepProperties { + /** + * List of base image dependencies for a step. + */ + @JsonProperty(value = "baseImageDependencies", access = JsonProperty.Access.WRITE_ONLY) + private List baseImageDependencies; + + /** + * The URL(absolute or relative) of the source context for the task step. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /** + * The token (git PAT or SAS token of storage account blob) associated with + * the context for a step. + */ + @JsonProperty(value = "contextAccessToken") + private String contextAccessToken; + + /** + * Get list of base image dependencies for a step. + * + * @return the baseImageDependencies value + */ + public List baseImageDependencies() { + return this.baseImageDependencies; + } + + /** + * Get the URL(absolute or relative) of the source context for the task step. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the URL(absolute or relative) of the source context for the task step. + * + * @param contextPath the contextPath value to set + * @return the TaskStepProperties object itself. + */ + public TaskStepProperties withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the token (git PAT or SAS token of storage account blob) associated with the context for a step. + * + * @return the contextAccessToken value + */ + public String contextAccessToken() { + return this.contextAccessToken; + } + + /** + * Set the token (git PAT or SAS token of storage account blob) associated with the context for a step. + * + * @param contextAccessToken the contextAccessToken value to set + * @return the TaskStepProperties object itself. + */ + public TaskStepProperties withContextAccessToken(String contextAccessToken) { + this.contextAccessToken = contextAccessToken; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStepUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStepUpdateParameters.java new file mode 100644 index 000000000000..aaa2d28b26c0 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskStepUpdateParameters.java @@ -0,0 +1,80 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base properties for updating any task step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", defaultImpl = TaskStepUpdateParameters.class) +@JsonTypeName("TaskStepUpdateParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Docker", value = DockerBuildStepUpdateParameters.class), + @JsonSubTypes.Type(name = "FileTask", value = FileTaskStepUpdateParameters.class), + @JsonSubTypes.Type(name = "EncodedTask", value = EncodedTaskStepUpdateParameters.class) +}) +public class TaskStepUpdateParameters { + /** + * The URL(absolute or relative) of the source context for the task step. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /** + * The token (git PAT or SAS token of storage account blob) associated with + * the context for a step. + */ + @JsonProperty(value = "contextAccessToken") + private String contextAccessToken; + + /** + * Get the URL(absolute or relative) of the source context for the task step. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the URL(absolute or relative) of the source context for the task step. + * + * @param contextPath the contextPath value to set + * @return the TaskStepUpdateParameters object itself. + */ + public TaskStepUpdateParameters withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the token (git PAT or SAS token of storage account blob) associated with the context for a step. + * + * @return the contextAccessToken value + */ + public String contextAccessToken() { + return this.contextAccessToken; + } + + /** + * Set the token (git PAT or SAS token of storage account blob) associated with the context for a step. + * + * @param contextAccessToken the contextAccessToken value to set + * @return the TaskStepUpdateParameters object itself. + */ + public TaskStepUpdateParameters withContextAccessToken(String contextAccessToken) { + this.contextAccessToken = contextAccessToken; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskUpdateParameters.java new file mode 100644 index 000000000000..d055c962bb70 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TaskUpdateParameters.java @@ -0,0 +1,282 @@ +/** + * 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_12_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a task. + */ +@JsonFlatten +public class TaskUpdateParameters { + /** + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** + * The current status of task. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "properties.status") + private TaskStatus status; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformUpdateParameters platform; + + /** + * The machine configuration of the run agent. + */ + @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. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The properties for updating a task step. + */ + @JsonProperty(value = "properties.step") + private TaskStepUpdateParameters step; + + /** + * The properties for updating trigger properties. + */ + @JsonProperty(value = "properties.trigger") + private TriggerUpdateParameters trigger; + + /** + * The parameters that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "properties.credentials") + private Credentials credentials; + + /** + * 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 TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the current status of task. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TaskStatus status() { + return this.status; + } + + /** + * Set the current status of task. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withStatus(TaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformUpdateParameters platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withPlatform(PlatformUpdateParameters platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = 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 TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withAgentPoolName(String agentPoolName) { + this.agentPoolName = agentPoolName; + return this; + } + + /** + * Get run timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the properties for updating a task step. + * + * @return the step value + */ + public TaskStepUpdateParameters step() { + return this.step; + } + + /** + * Set the properties for updating a task step. + * + * @param step the step value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withStep(TaskStepUpdateParameters step) { + this.step = step; + return this; + } + + /** + * Get the properties for updating trigger properties. + * + * @return the trigger value + */ + public TriggerUpdateParameters trigger() { + return this.trigger; + } + + /** + * Set the properties for updating trigger properties. + * + * @param trigger the trigger value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTrigger(TriggerUpdateParameters trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the parameters that describes a set of credentials that will be used when this run is invoked. + * + * @return the credentials value + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the parameters that describes a set of credentials that will be used when this run is invoked. + * + * @param credentials the credentials value to set + * @return the TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withCredentials(Credentials credentials) { + this.credentials = credentials; + 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 TaskUpdateParameters object itself. + */ + public TaskUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Tasks.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Tasks.java new file mode 100644 index 000000000000..2273c4b72022 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Tasks.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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.TasksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tasks. + */ +public interface Tasks extends SupportsCreating, HasInner { + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getDetailsAsync(String resourceGroupName, String registryName, String taskName); + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String taskName); + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String taskName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTrigger.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTrigger.java new file mode 100644 index 000000000000..55ae071a9b72 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTrigger.java @@ -0,0 +1,96 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a timer trigger. + */ +public class TimerTrigger { + /** + * The CRON expression for the task schedule. + */ + @JsonProperty(value = "schedule", required = true) + private String schedule; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the CRON expression for the task schedule. + * + * @return the schedule value + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the CRON expression for the task schedule. + * + * @param schedule the schedule value to set + * @return the TimerTrigger object itself. + */ + public TimerTrigger withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the TimerTrigger object itself. + */ + public TimerTrigger withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the TimerTrigger object itself. + */ + public TimerTrigger withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTriggerDescriptor.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTriggerDescriptor.java new file mode 100644 index 000000000000..59f83b587eca --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTriggerDescriptor.java @@ -0,0 +1,69 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The TimerTriggerDescriptor model. + */ +public class TimerTriggerDescriptor { + /** + * The timer trigger name that caused the run. + */ + @JsonProperty(value = "timerTriggerName") + private String timerTriggerName; + + /** + * The occurrence that triggered the run. + */ + @JsonProperty(value = "scheduleOccurrence") + private String scheduleOccurrence; + + /** + * Get the timer trigger name that caused the run. + * + * @return the timerTriggerName value + */ + public String timerTriggerName() { + return this.timerTriggerName; + } + + /** + * Set the timer trigger name that caused the run. + * + * @param timerTriggerName the timerTriggerName value to set + * @return the TimerTriggerDescriptor object itself. + */ + public TimerTriggerDescriptor withTimerTriggerName(String timerTriggerName) { + this.timerTriggerName = timerTriggerName; + return this; + } + + /** + * Get the occurrence that triggered the run. + * + * @return the scheduleOccurrence value + */ + public String scheduleOccurrence() { + return this.scheduleOccurrence; + } + + /** + * Set the occurrence that triggered the run. + * + * @param scheduleOccurrence the scheduleOccurrence value to set + * @return the TimerTriggerDescriptor object itself. + */ + public TimerTriggerDescriptor withScheduleOccurrence(String scheduleOccurrence) { + this.scheduleOccurrence = scheduleOccurrence; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTriggerUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTriggerUpdateParameters.java new file mode 100644 index 000000000000..91aadc3b3417 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TimerTriggerUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating a timer trigger. + */ +public class TimerTriggerUpdateParameters { + /** + * The CRON expression for the task schedule. + */ + @JsonProperty(value = "schedule") + private String schedule; + + /** + * The current status of trigger. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "status") + private TriggerStatus status; + + /** + * The name of the trigger. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Get the CRON expression for the task schedule. + * + * @return the schedule value + */ + public String schedule() { + return this.schedule; + } + + /** + * Set the CRON expression for the task schedule. + * + * @param schedule the schedule value to set + * @return the TimerTriggerUpdateParameters object itself. + */ + public TimerTriggerUpdateParameters withSchedule(String schedule) { + this.schedule = schedule; + return this; + } + + /** + * Get the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TriggerStatus status() { + return this.status; + } + + /** + * Set the current status of trigger. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the TimerTriggerUpdateParameters object itself. + */ + public TimerTriggerUpdateParameters withStatus(TriggerStatus status) { + this.status = status; + return this; + } + + /** + * Get the name of the trigger. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the trigger. + * + * @param name the name value to set + * @return the TimerTriggerUpdateParameters object itself. + */ + public TimerTriggerUpdateParameters withName(String name) { + this.name = name; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Token.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Token.java new file mode 100644 index 000000000000..7dbaedd63448 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Token.java @@ -0,0 +1,186 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.TokenInner; +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_12_01_preview.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; + +/** + * Type representing Token. + */ +public interface Token extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the credentials value. + */ + TokenCredentialsProperties credentials(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the scopeMapId value. + */ + String scopeMapId(); + + /** + * @return the status value. + */ + TokenStatus status(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Token definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithCreate { + } + + /** + * Grouping of Token definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Token definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the token 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 token definition allowing to specify Credentials. + */ + interface WithCredentials { + /** + * Specifies credentials. + * @param credentials The credentials that can be used for authenticating the token + * @return the next definition stage + */ + WithCreate withCredentials(TokenCredentialsProperties credentials); + } + + /** + * The stage of the token definition allowing to specify ScopeMapId. + */ + interface WithScopeMapId { + /** + * Specifies scopeMapId. + * @param scopeMapId The resource ID of the scope map to which the token will be associated with + * @return the next definition stage + */ + WithCreate withScopeMapId(String scopeMapId); + } + + /** + * The stage of the token definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The status of the token example enabled or disabled. Possible values include: 'enabled', 'disabled' + * @return the next definition stage + */ + WithCreate withStatus(TokenStatus status); + } + + /** + * 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.WithCredentials, DefinitionStages.WithScopeMapId, DefinitionStages.WithStatus { + } + } + /** + * The template for a Token update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithCredentials, UpdateStages.WithScopeMapId, UpdateStages.WithStatus { + } + + /** + * Grouping of Token update stages. + */ + interface UpdateStages { + /** + * The stage of the token update allowing to specify Credentials. + */ + interface WithCredentials { + /** + * Specifies credentials. + * @param credentials The credentials that can be used for authenticating the token + * @return the next update stage + */ + Update withCredentials(TokenCredentialsProperties credentials); + } + + /** + * The stage of the token update allowing to specify ScopeMapId. + */ + interface WithScopeMapId { + /** + * Specifies scopeMapId. + * @param scopeMapId The resource ID of the scope map to which the token will be associated with + * @return the next update stage + */ + Update withScopeMapId(String scopeMapId); + } + + /** + * The stage of the token update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The status of the token example enabled or disabled. Possible values include: 'enabled', 'disabled' + * @return the next update stage + */ + Update withStatus(TokenStatus status); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCertificate.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCertificate.java new file mode 100644 index 000000000000..a98c9199b59c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCertificate.java @@ -0,0 +1,123 @@ +/** + * 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_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a certificate used for authenticating a token. + */ +public class TokenCertificate { + /** + * Possible values include: 'certificate1', 'certificate2'. + */ + @JsonProperty(value = "name") + private TokenCertificateName name; + + /** + * The expiry datetime of the certificate. + */ + @JsonProperty(value = "expiry") + private DateTime expiry; + + /** + * The thumbprint of the certificate. + */ + @JsonProperty(value = "thumbprint") + private String thumbprint; + + /** + * Base 64 encoded string of the public certificate1 in PEM format that + * will be used for authenticating the token. + */ + @JsonProperty(value = "encodedPemCertificate") + private String encodedPemCertificate; + + /** + * Get possible values include: 'certificate1', 'certificate2'. + * + * @return the name value + */ + public TokenCertificateName name() { + return this.name; + } + + /** + * Set possible values include: 'certificate1', 'certificate2'. + * + * @param name the name value to set + * @return the TokenCertificate object itself. + */ + public TokenCertificate withName(TokenCertificateName name) { + this.name = name; + return this; + } + + /** + * Get the expiry datetime of the certificate. + * + * @return the expiry value + */ + public DateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry datetime of the certificate. + * + * @param expiry the expiry value to set + * @return the TokenCertificate object itself. + */ + public TokenCertificate withExpiry(DateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the thumbprint of the certificate. + * + * @return the thumbprint value + */ + public String thumbprint() { + return this.thumbprint; + } + + /** + * Set the thumbprint of the certificate. + * + * @param thumbprint the thumbprint value to set + * @return the TokenCertificate object itself. + */ + public TokenCertificate withThumbprint(String thumbprint) { + this.thumbprint = thumbprint; + return this; + } + + /** + * Get base 64 encoded string of the public certificate1 in PEM format that will be used for authenticating the token. + * + * @return the encodedPemCertificate value + */ + public String encodedPemCertificate() { + return this.encodedPemCertificate; + } + + /** + * Set base 64 encoded string of the public certificate1 in PEM format that will be used for authenticating the token. + * + * @param encodedPemCertificate the encodedPemCertificate value to set + * @return the TokenCertificate object itself. + */ + public TokenCertificate withEncodedPemCertificate(String encodedPemCertificate) { + this.encodedPemCertificate = encodedPemCertificate; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCertificateName.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCertificateName.java new file mode 100644 index 000000000000..e5f80681117a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCertificateName.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TokenCertificateName. + */ +public final class TokenCertificateName extends ExpandableStringEnum { + /** Static value certificate1 for TokenCertificateName. */ + public static final TokenCertificateName CERTIFICATE1 = fromString("certificate1"); + + /** Static value certificate2 for TokenCertificateName. */ + public static final TokenCertificateName CERTIFICATE2 = fromString("certificate2"); + + /** + * Creates or finds a TokenCertificateName from its string representation. + * @param name a name to look for + * @return the corresponding TokenCertificateName + */ + @JsonCreator + public static TokenCertificateName fromString(String name) { + return fromString(name, TokenCertificateName.class); + } + + /** + * @return known TokenCertificateName values + */ + public static Collection values() { + return values(TokenCertificateName.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCredentialsProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCredentialsProperties.java new file mode 100644 index 000000000000..021d8cf65eb1 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenCredentialsProperties.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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the credentials that can be used for authenticating the + * token. + */ +public class TokenCredentialsProperties { + /** + * The activeDirectoryObject property. + */ + @JsonProperty(value = "activeDirectoryObject") + private ActiveDirectoryObject activeDirectoryObject; + + /** + * The certificates property. + */ + @JsonProperty(value = "certificates") + private List certificates; + + /** + * The passwords property. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the activeDirectoryObject value. + * + * @return the activeDirectoryObject value + */ + public ActiveDirectoryObject activeDirectoryObject() { + return this.activeDirectoryObject; + } + + /** + * Set the activeDirectoryObject value. + * + * @param activeDirectoryObject the activeDirectoryObject value to set + * @return the TokenCredentialsProperties object itself. + */ + public TokenCredentialsProperties withActiveDirectoryObject(ActiveDirectoryObject activeDirectoryObject) { + this.activeDirectoryObject = activeDirectoryObject; + return this; + } + + /** + * Get the certificates value. + * + * @return the certificates value + */ + public List certificates() { + return this.certificates; + } + + /** + * Set the certificates value. + * + * @param certificates the certificates value to set + * @return the TokenCredentialsProperties object itself. + */ + public TokenCredentialsProperties withCertificates(List certificates) { + this.certificates = certificates; + return this; + } + + /** + * Get the passwords value. + * + * @return the passwords value + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the passwords value. + * + * @param passwords the passwords value to set + * @return the TokenCredentialsProperties object itself. + */ + public TokenCredentialsProperties withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenPassword.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenPassword.java new file mode 100644 index 000000000000..08825df71c7e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenPassword.java @@ -0,0 +1,113 @@ +/** + * 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_12_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The password that will be used for authenticating the token of a container + * registry. + */ +public class TokenPassword { + /** + * The creation datetime of the password. + */ + @JsonProperty(value = "creationTime") + private DateTime creationTime; + + /** + * The expiry datetime of the password. + */ + @JsonProperty(value = "expiry") + private DateTime expiry; + + /** + * The password name "password1" or "password2". Possible values include: + * 'password1', 'password2'. + */ + @JsonProperty(value = "name") + private TokenPasswordName name; + + /** + * The password value. + */ + @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) + private String value; + + /** + * Get the creation datetime of the password. + * + * @return the creationTime value + */ + public DateTime creationTime() { + return this.creationTime; + } + + /** + * Set the creation datetime of the password. + * + * @param creationTime the creationTime value to set + * @return the TokenPassword object itself. + */ + public TokenPassword withCreationTime(DateTime creationTime) { + this.creationTime = creationTime; + return this; + } + + /** + * Get the expiry datetime of the password. + * + * @return the expiry value + */ + public DateTime expiry() { + return this.expiry; + } + + /** + * Set the expiry datetime of the password. + * + * @param expiry the expiry value to set + * @return the TokenPassword object itself. + */ + public TokenPassword withExpiry(DateTime expiry) { + this.expiry = expiry; + return this; + } + + /** + * Get the password name "password1" or "password2". Possible values include: 'password1', 'password2'. + * + * @return the name value + */ + public TokenPasswordName name() { + return this.name; + } + + /** + * Set the password name "password1" or "password2". Possible values include: 'password1', 'password2'. + * + * @param name the name value to set + * @return the TokenPassword object itself. + */ + public TokenPassword withName(TokenPasswordName name) { + this.name = name; + return this; + } + + /** + * Get the password value. + * + * @return the value value + */ + public String value() { + return this.value; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenPasswordName.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenPasswordName.java new file mode 100644 index 000000000000..d67190b637bb --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenPasswordName.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TokenPasswordName. + */ +public final class TokenPasswordName extends ExpandableStringEnum { + /** Static value password1 for TokenPasswordName. */ + public static final TokenPasswordName PASSWORD1 = fromString("password1"); + + /** Static value password2 for TokenPasswordName. */ + public static final TokenPasswordName PASSWORD2 = fromString("password2"); + + /** + * Creates or finds a TokenPasswordName from its string representation. + * @param name a name to look for + * @return the corresponding TokenPasswordName + */ + @JsonCreator + public static TokenPasswordName fromString(String name) { + return fromString(name, TokenPasswordName.class); + } + + /** + * @return known TokenPasswordName values + */ + public static Collection values() { + return values(TokenPasswordName.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenStatus.java new file mode 100644 index 000000000000..e4e38b7aeeef --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenStatus.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TokenStatus. + */ +public final class TokenStatus extends ExpandableStringEnum { + /** Static value enabled for TokenStatus. */ + public static final TokenStatus ENABLED = fromString("enabled"); + + /** Static value disabled for TokenStatus. */ + public static final TokenStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a TokenStatus from its string representation. + * @param name a name to look for + * @return the corresponding TokenStatus + */ + @JsonCreator + public static TokenStatus fromString(String name) { + return fromString(name, TokenStatus.class); + } + + /** + * @return known TokenStatus values + */ + public static Collection values() { + return values(TokenStatus.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenType.java new file mode 100644 index 000000000000..d7949ffd3931 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenType.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TokenType. + */ +public final class TokenType extends ExpandableStringEnum { + /** Static value PAT for TokenType. */ + public static final TokenType PAT = fromString("PAT"); + + /** Static value OAuth for TokenType. */ + public static final TokenType OAUTH = fromString("OAuth"); + + /** + * Creates or finds a TokenType from its string representation. + * @param name a name to look for + * @return the corresponding TokenType + */ + @JsonCreator + public static TokenType fromString(String name) { + return fromString(name, TokenType.class); + } + + /** + * @return known TokenType values + */ + public static Collection values() { + return values(TokenType.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenUpdateParameters.java new file mode 100644 index 000000000000..de39bd17141b --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TokenUpdateParameters.java @@ -0,0 +1,99 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a token. + */ +@JsonFlatten +public class TokenUpdateParameters { + /** + * The resource ID of the scope map to which the token will be associated + * with. + */ + @JsonProperty(value = "properties.scopeMapId") + private String scopeMapId; + + /** + * The status of the token example enabled or disabled. Possible values + * include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private TokenStatus status; + + /** + * The credentials that can be used for authenticating the token. + */ + @JsonProperty(value = "properties.credentials") + private TokenCredentialsProperties credentials; + + /** + * Get the resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value + */ + public String scopeMapId() { + return this.scopeMapId; + } + + /** + * Set the resource ID of the scope map to which the token will be associated with. + * + * @param scopeMapId the scopeMapId value to set + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withScopeMapId(String scopeMapId) { + this.scopeMapId = scopeMapId; + return this; + } + + /** + * Get the status of the token example enabled or disabled. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public TokenStatus status() { + return this.status; + } + + /** + * Set the status of the token example enabled or disabled. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withStatus(TokenStatus status) { + this.status = status; + return this; + } + + /** + * Get the credentials that can be used for authenticating the token. + * + * @return the credentials value + */ + public TokenCredentialsProperties credentials() { + return this.credentials; + } + + /** + * Set the credentials that can be used for authenticating the token. + * + * @param credentials the credentials value to set + * @return the TokenUpdateParameters object itself. + */ + public TokenUpdateParameters withCredentials(TokenCredentialsProperties credentials) { + this.credentials = credentials; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Tokens.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Tokens.java new file mode 100644 index 000000000000..86b065483474 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Tokens.java @@ -0,0 +1,53 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.TokensInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Tokens. + */ +public interface Tokens extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String tokenName); + + /** + * Lists all the tokens for the 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 token from a 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 tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String tokenName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerProperties.java new file mode 100644 index 000000000000..e12ffa516b51 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerProperties.java @@ -0,0 +1,96 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a trigger. + */ +public class TriggerProperties { + /** + * The collection of timer triggers. + */ + @JsonProperty(value = "timerTriggers") + private List timerTriggers; + + /** + * The collection of triggers based on source code repository. + */ + @JsonProperty(value = "sourceTriggers") + private List sourceTriggers; + + /** + * The trigger based on base image dependencies. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTrigger baseImageTrigger; + + /** + * Get the collection of timer triggers. + * + * @return the timerTriggers value + */ + public List timerTriggers() { + return this.timerTriggers; + } + + /** + * Set the collection of timer triggers. + * + * @param timerTriggers the timerTriggers value to set + * @return the TriggerProperties object itself. + */ + public TriggerProperties withTimerTriggers(List timerTriggers) { + this.timerTriggers = timerTriggers; + return this; + } + + /** + * Get the collection of triggers based on source code repository. + * + * @return the sourceTriggers value + */ + public List sourceTriggers() { + return this.sourceTriggers; + } + + /** + * Set the collection of triggers based on source code repository. + * + * @param sourceTriggers the sourceTriggers value to set + * @return the TriggerProperties object itself. + */ + public TriggerProperties withSourceTriggers(List sourceTriggers) { + this.sourceTriggers = sourceTriggers; + return this; + } + + /** + * Get the trigger based on base image dependencies. + * + * @return the baseImageTrigger value + */ + public BaseImageTrigger baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the trigger based on base image dependencies. + * + * @param baseImageTrigger the baseImageTrigger value to set + * @return the TriggerProperties object itself. + */ + public TriggerProperties withBaseImageTrigger(BaseImageTrigger baseImageTrigger) { + this.baseImageTrigger = baseImageTrigger; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerStatus.java new file mode 100644 index 000000000000..729877ed302d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerStatus.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TriggerStatus. + */ +public final class TriggerStatus extends ExpandableStringEnum { + /** Static value Disabled for TriggerStatus. */ + public static final TriggerStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for TriggerStatus. */ + public static final TriggerStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a TriggerStatus from its string representation. + * @param name a name to look for + * @return the corresponding TriggerStatus + */ + @JsonCreator + public static TriggerStatus fromString(String name) { + return fromString(name, TriggerStatus.class); + } + + /** + * @return known TriggerStatus values + */ + public static Collection values() { + return values(TriggerStatus.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerUpdateParameters.java new file mode 100644 index 000000000000..265cf6f9aaff --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TriggerUpdateParameters.java @@ -0,0 +1,96 @@ +/** + * 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_12_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating triggers. + */ +public class TriggerUpdateParameters { + /** + * The collection of timer triggers. + */ + @JsonProperty(value = "timerTriggers") + private List timerTriggers; + + /** + * The collection of triggers based on source code repository. + */ + @JsonProperty(value = "sourceTriggers") + private List sourceTriggers; + + /** + * The trigger based on base image dependencies. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTriggerUpdateParameters baseImageTrigger; + + /** + * Get the collection of timer triggers. + * + * @return the timerTriggers value + */ + public List timerTriggers() { + return this.timerTriggers; + } + + /** + * Set the collection of timer triggers. + * + * @param timerTriggers the timerTriggers value to set + * @return the TriggerUpdateParameters object itself. + */ + public TriggerUpdateParameters withTimerTriggers(List timerTriggers) { + this.timerTriggers = timerTriggers; + return this; + } + + /** + * Get the collection of triggers based on source code repository. + * + * @return the sourceTriggers value + */ + public List sourceTriggers() { + return this.sourceTriggers; + } + + /** + * Set the collection of triggers based on source code repository. + * + * @param sourceTriggers the sourceTriggers value to set + * @return the TriggerUpdateParameters object itself. + */ + public TriggerUpdateParameters withSourceTriggers(List sourceTriggers) { + this.sourceTriggers = sourceTriggers; + return this; + } + + /** + * Get the trigger based on base image dependencies. + * + * @return the baseImageTrigger value + */ + public BaseImageTriggerUpdateParameters baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the trigger based on base image dependencies. + * + * @param baseImageTrigger the baseImageTrigger value to set + * @return the TriggerUpdateParameters object itself. + */ + public TriggerUpdateParameters withBaseImageTrigger(BaseImageTriggerUpdateParameters baseImageTrigger) { + this.baseImageTrigger = baseImageTrigger; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TrustPolicy.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TrustPolicy.java new file mode 100644 index 000000000000..4cf6f029446d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TrustPolicy.java @@ -0,0 +1,70 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The content trust policy for a container registry. + */ +public class TrustPolicy { + /** + * The type of trust policy. Possible values include: 'Notary'. + */ + @JsonProperty(value = "type") + private TrustPolicyType type; + + /** + * The value that indicates whether the policy is enabled or not. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "status") + private PolicyStatus status; + + /** + * Get the type of trust policy. Possible values include: 'Notary'. + * + * @return the type value + */ + public TrustPolicyType type() { + return this.type; + } + + /** + * Set the type of trust policy. Possible values include: 'Notary'. + * + * @param type the type value to set + * @return the TrustPolicy object itself. + */ + public TrustPolicy withType(TrustPolicyType type) { + this.type = type; + return this; + } + + /** + * Get the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public PolicyStatus status() { + return this.status; + } + + /** + * Set the value that indicates whether the policy is enabled or not. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the TrustPolicy object itself. + */ + public TrustPolicy withStatus(PolicyStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TrustPolicyType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TrustPolicyType.java new file mode 100644 index 000000000000..3358d8e033f5 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/TrustPolicyType.java @@ -0,0 +1,38 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TrustPolicyType. + */ +public final class TrustPolicyType extends ExpandableStringEnum { + /** Static value Notary for TrustPolicyType. */ + public static final TrustPolicyType NOTARY = fromString("Notary"); + + /** + * Creates or finds a TrustPolicyType from its string representation. + * @param name a name to look for + * @return the corresponding TrustPolicyType + */ + @JsonCreator + public static TrustPolicyType fromString(String name) { + return fromString(name, TrustPolicyType.class); + } + + /** + * @return known TrustPolicyType values + */ + public static Collection values() { + return values(TrustPolicyType.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/UpdateTriggerPayloadType.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/UpdateTriggerPayloadType.java new file mode 100644 index 000000000000..857bf1e9d862 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/UpdateTriggerPayloadType.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for UpdateTriggerPayloadType. + */ +public final class UpdateTriggerPayloadType extends ExpandableStringEnum { + /** Static value Default for UpdateTriggerPayloadType. */ + public static final UpdateTriggerPayloadType DEFAULT = fromString("Default"); + + /** Static value Token for UpdateTriggerPayloadType. */ + public static final UpdateTriggerPayloadType TOKEN = fromString("Token"); + + /** + * Creates or finds a UpdateTriggerPayloadType from its string representation. + * @param name a name to look for + * @return the corresponding UpdateTriggerPayloadType + */ + @JsonCreator + public static UpdateTriggerPayloadType fromString(String name) { + return fromString(name, UpdateTriggerPayloadType.class); + } + + /** + * @return known UpdateTriggerPayloadType values + */ + public static Collection values() { + return values(UpdateTriggerPayloadType.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/UserIdentityProperties.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/UserIdentityProperties.java new file mode 100644 index 000000000000..cb33dfb8879f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/UserIdentityProperties.java @@ -0,0 +1,69 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The UserIdentityProperties model. + */ +public class UserIdentityProperties { + /** + * The principal id of user assigned identity. + */ + @JsonProperty(value = "principalId") + private String principalId; + + /** + * The client id of user assigned identity. + */ + @JsonProperty(value = "clientId") + private String clientId; + + /** + * Get the principal id of user assigned identity. + * + * @return the principalId value + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principal id of user assigned identity. + * + * @param principalId the principalId value to set + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the client id of user assigned identity. + * + * @return the clientId value + */ + public String clientId() { + return this.clientId; + } + + /** + * Set the client id of user assigned identity. + * + * @param clientId the clientId value to set + * @return the UserIdentityProperties object itself. + */ + public UserIdentityProperties withClientId(String clientId) { + this.clientId = clientId; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Variant.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Variant.java new file mode 100644 index 000000000000..9daee1bc40ad --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Variant.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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for Variant. + */ +public final class Variant extends ExpandableStringEnum { + /** Static value v6 for Variant. */ + public static final Variant V6 = fromString("v6"); + + /** Static value v7 for Variant. */ + public static final Variant V7 = fromString("v7"); + + /** Static value v8 for Variant. */ + public static final Variant V8 = fromString("v8"); + + /** + * Creates or finds a Variant from its string representation. + * @param name a name to look for + * @return the corresponding Variant + */ + @JsonCreator + public static Variant fromString(String name) { + return fromString(name, Variant.class); + } + + /** + * @return known Variant values + */ + public static Collection values() { + return values(Variant.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/VirtualNetworkRule.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/VirtualNetworkRule.java new file mode 100644 index 000000000000..d2757085771b --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/VirtualNetworkRule.java @@ -0,0 +1,70 @@ +/** + * 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_12_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Virtual network rule. + */ +public class VirtualNetworkRule { + /** + * The action of virtual network rule. Possible values include: 'Allow'. + */ + @JsonProperty(value = "action") + private Action action; + + /** + * Resource ID of a subnet, for example: + * /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + */ + @JsonProperty(value = "id", required = true) + private String virtualNetworkResourceId; + + /** + * Get the action of virtual network rule. Possible values include: 'Allow'. + * + * @return the action value + */ + public Action action() { + return this.action; + } + + /** + * Set the action of virtual network rule. Possible values include: 'Allow'. + * + * @param action the action value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withAction(Action action) { + this.action = action; + return this; + } + + /** + * Get resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @return the virtualNetworkResourceId value + */ + public String virtualNetworkResourceId() { + return this.virtualNetworkResourceId; + } + + /** + * Set resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + * + * @param virtualNetworkResourceId the virtualNetworkResourceId value to set + * @return the VirtualNetworkRule object itself. + */ + public VirtualNetworkRule withVirtualNetworkResourceId(String virtualNetworkResourceId) { + this.virtualNetworkResourceId = virtualNetworkResourceId; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Webhook.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Webhook.java new file mode 100644 index 000000000000..7e6be7b657c5 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Webhook.java @@ -0,0 +1,276 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.WebhookInner; +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_12_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing Webhook. + */ +public interface Webhook extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the status value. + */ + WebhookStatus status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Webhook definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithActions, DefinitionStages.WithLocation, DefinitionStages.WithServiceUri, DefinitionStages.WithCreate { + } + + /** + * Grouping of Webhook definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Webhook definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the webhook 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 + */ + WithActions withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the webhook definition allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + * @param actions The list of actions that trigger the webhook to post notifications + * @return the next definition stage + */ + WithLocation withActions(List actions); + } + + /** + * The stage of the webhook definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + * @param location The location of the webhook. This cannot be changed after the resource is created + * @return the next definition stage + */ + WithServiceUri withLocation(String location); + } + + /** + * The stage of the webhook definition allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + * @param serviceUri The service URI for the webhook to post notifications + * @return the next definition stage + */ + WithCreate withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook definition allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + * @param customHeaders Custom headers that will be added to the webhook notifications + * @return the next definition stage + */ + WithCreate withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events + * @return the next definition stage + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the webhook definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled' + * @return the next definition stage + */ + WithCreate withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the webhook + * @return the next definition stage + */ + WithCreate withTags(Map tags); + } + + /** + * 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.WithCustomHeaders, DefinitionStages.WithScope, DefinitionStages.WithStatus, DefinitionStages.WithTags { + } + } + /** + * The template for a Webhook update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithActions, UpdateStages.WithCustomHeaders, UpdateStages.WithScope, UpdateStages.WithServiceUri, UpdateStages.WithStatus, UpdateStages.WithTags { + } + + /** + * Grouping of Webhook update stages. + */ + interface UpdateStages { + /** + * The stage of the webhook update allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + * @param actions The list of actions that trigger the webhook to post notifications + * @return the next update stage + */ + Update withActions(List actions); + } + + /** + * The stage of the webhook update allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + * @param customHeaders Custom headers that will be added to the webhook notifications + * @return the next update stage + */ + Update withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook update allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + * @param scope The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events + * @return the next update stage + */ + Update withScope(String scope); + } + + /** + * The stage of the webhook update allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + * @param serviceUri The service URI for the webhook to post notifications + * @return the next update stage + */ + Update withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + * @param status The status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled' + * @return the next update stage + */ + Update withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + * @param tags The tags for the webhook + * @return the next update stage + */ + Update withTags(Map tags); + } + + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookAction.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookAction.java new file mode 100644 index 000000000000..6e3118b325bf --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookAction.java @@ -0,0 +1,50 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookAction. + */ +public final class WebhookAction extends ExpandableStringEnum { + /** Static value push for WebhookAction. */ + public static final WebhookAction PUSH = fromString("push"); + + /** Static value delete for WebhookAction. */ + public static final WebhookAction DELETE = fromString("delete"); + + /** Static value quarantine for WebhookAction. */ + public static final WebhookAction QUARANTINE = fromString("quarantine"); + + /** Static value chart_push for WebhookAction. */ + public static final WebhookAction CHART_PUSH = fromString("chart_push"); + + /** Static value chart_delete for WebhookAction. */ + public static final WebhookAction CHART_DELETE = fromString("chart_delete"); + + /** + * Creates or finds a WebhookAction from its string representation. + * @param name a name to look for + * @return the corresponding WebhookAction + */ + @JsonCreator + public static WebhookAction fromString(String name) { + return fromString(name, WebhookAction.class); + } + + /** + * @return known WebhookAction values + */ + public static Collection values() { + return values(WebhookAction.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookCreateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookCreateParameters.java new file mode 100644 index 000000000000..cf1f14a3cd49 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookCreateParameters.java @@ -0,0 +1,208 @@ +/** + * 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_12_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for creating a webhook. + */ +@JsonFlatten +public class WebhookCreateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The location of the webhook. This cannot be changed after the resource + * is created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location of the webhook. This cannot be changed after the resource is created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the webhook. This cannot be changed after the resource is created. + * + * @param location the location value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookStatus.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookStatus.java new file mode 100644 index 000000000000..161dc4ba2d61 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookStatus.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookStatus. + */ +public final class WebhookStatus extends ExpandableStringEnum { + /** Static value enabled for WebhookStatus. */ + public static final WebhookStatus ENABLED = fromString("enabled"); + + /** Static value disabled for WebhookStatus. */ + public static final WebhookStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a WebhookStatus from its string representation. + * @param name a name to look for + * @return the corresponding WebhookStatus + */ + @JsonCreator + public static WebhookStatus fromString(String name) { + return fromString(name, WebhookStatus.class); + } + + /** + * @return known WebhookStatus values + */ + public static Collection values() { + return values(WebhookStatus.class); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookUpdateParameters.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookUpdateParameters.java new file mode 100644 index 000000000000..6f39f0032b02 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/WebhookUpdateParameters.java @@ -0,0 +1,181 @@ +/** + * 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_12_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a webhook. + */ +@JsonFlatten +public class WebhookUpdateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri") + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Webhooks.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Webhooks.java new file mode 100644 index 000000000000..5462fd3ef39d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/Webhooks.java @@ -0,0 +1,86 @@ +/** + * 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_12_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation.WebhooksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Webhooks. + */ +public interface Webhooks extends SupportsCreating, HasInner { + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable pingAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists all the webhooks for the 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 webhook from a 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 webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String webhookName); + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolImpl.java new file mode 100644 index 000000000000..c23549d72f3f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.AgentPool; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.AgentPoolUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.OS; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolInner.java new file mode 100644 index 000000000000..ffa1f52c72df --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.OS; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolQueueStatusImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolQueueStatusImpl.java new file mode 100644 index 000000000000..64d7e46b706b --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolQueueStatusInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolQueueStatusInner.java new file mode 100644 index 000000000000..c3ef94a6c836 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolsImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolsImpl.java new file mode 100644 index 000000000000..71a90ad92971 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_01_preview.AgentPoolQueueStatus; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolsInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolsInner.java new file mode 100644 index 000000000000..6d7b21031f42 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/AgentPoolsInner.java @@ -0,0 +1,1052 @@ +/** + * 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_12_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_12_01_preview.AgentPoolUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ErrorSchemaException; +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_12_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_12_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_12_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_12_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_12_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_12_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_12_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_12_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_12_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_12_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 ErrorSchemaException 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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.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 ErrorSchemaException 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 (agentPool == null) { + throw new IllegalArgumentException("Parameter agentPool is required and cannot be null."); + } + Validator.validate(agentPool); + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, 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 ErrorSchemaException 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 (agentPool == null) { + throw new IllegalArgumentException("Parameter agentPool is required and cannot be null."); + } + Validator.validate(agentPool); + final String apiVersion = "2019-06-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.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 ErrorSchemaException 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."); + } + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, 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 ErrorSchemaException 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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, 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 ErrorSchemaException, 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(ErrorSchemaException.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 ErrorSchemaException 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 (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, 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 ErrorSchemaException 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 (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + final String apiVersion = "2019-06-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.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 ErrorSchemaException 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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorSchemaException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorSchemaException.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 ErrorSchemaException 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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.getQueueStatus(this.client.subscriptionId(), resourceGroupName, registryName, agentPoolName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.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 ErrorSchemaException 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorSchemaException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/CallbackConfigImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/CallbackConfigImpl.java new file mode 100644 index 000000000000..1daff90841be --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/CallbackConfigImpl.java @@ -0,0 +1,37 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.CallbackConfig; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class CallbackConfigImpl extends WrapperImpl implements CallbackConfig { + private final ContainerRegistryManager manager; + CallbackConfigImpl(CallbackConfigInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Map customHeaders() { + return this.inner().customHeaders(); + } + + @Override + public String serviceUri() { + return this.inner().serviceUri(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/CallbackConfigInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/CallbackConfigInner.java new file mode 100644 index 000000000000..3806a6953749 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/CallbackConfigInner.java @@ -0,0 +1,70 @@ +/** + * 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_12_01_preview.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration of service URI and custom headers for the webhook. + */ +public class CallbackConfigInner { + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + private Map customHeaders; + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ContainerRegistryManagementClientImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 000000000000..8f81a243f19a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ContainerRegistryManagementClientImpl.java @@ -0,0 +1,323 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerRegistryManagementClientImpl class. + */ +public class ContainerRegistryManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets The preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets The preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** The retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets The retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The RegistriesInner object to access its operations. + */ + private RegistriesInner registries; + + /** + * Gets the RegistriesInner object to access its operations. + * @return the RegistriesInner object. + */ + public RegistriesInner registries() { + return this.registries; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The PrivateEndpointConnectionsInner object to access its operations. + */ + private PrivateEndpointConnectionsInner privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsInner object to access its operations. + * @return the PrivateEndpointConnectionsInner object. + */ + public PrivateEndpointConnectionsInner privateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The ReplicationsInner object to access its operations. + */ + private ReplicationsInner replications; + + /** + * Gets the ReplicationsInner object to access its operations. + * @return the ReplicationsInner object. + */ + public ReplicationsInner replications() { + return this.replications; + } + + /** + * The WebhooksInner object to access its operations. + */ + private WebhooksInner webhooks; + + /** + * Gets the WebhooksInner object to access its operations. + * @return the WebhooksInner object. + */ + public WebhooksInner webhooks() { + return this.webhooks; + } + + /** + * 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 RunsInner object to access its operations. + */ + private RunsInner runs; + + /** + * Gets the RunsInner object to access its operations. + * @return the RunsInner object. + */ + 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. + */ + private TasksInner tasks; + + /** + * Gets the TasksInner object to access its operations. + * @return the TasksInner object. + */ + public TasksInner tasks() { + return this.tasks; + } + + /** + * The ScopeMapsInner object to access its operations. + */ + private ScopeMapsInner scopeMaps; + + /** + * Gets the ScopeMapsInner object to access its operations. + * @return the ScopeMapsInner object. + */ + public ScopeMapsInner scopeMaps() { + return this.scopeMaps; + } + + /** + * The TokensInner object to access its operations. + */ + private TokensInner tokens; + + /** + * Gets the TokensInner object to access its operations. + * @return the TokensInner object. + */ + public TokensInner tokens() { + return this.tokens; + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerRegistryManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.registries = new RegistriesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.privateEndpointConnections = new PrivateEndpointConnectionsInner(restClient().retrofit(), this); + this.replications = new ReplicationsInner(restClient().retrofit(), this); + this.webhooks = new WebhooksInner(restClient().retrofit(), this); + this.agentPools = new AgentPoolsInner(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.scopeMaps = new ScopeMapsInner(restClient().retrofit(), this); + this.tokens = new TokensInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s, auto-generated)", super.userAgent(), "ContainerRegistryManagementClient", "2019-12-01-preiew"); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ContainerRegistryManager.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ContainerRegistryManager.java new file mode 100644 index 000000000000..530a38243bef --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ContainerRegistryManager.java @@ -0,0 +1,219 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +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_12_01_preview.Registries; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Operations; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateEndpointConnections; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Replications; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Webhooks; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.AgentPools; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Runs; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskRuns; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Tasks; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ScopeMaps; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Tokens; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerRegistry resource management. + */ +public final class ContainerRegistryManager extends ManagerCore { + private Registries registries; + private Operations operations; + private PrivateEndpointConnections privateEndpointConnections; + private Replications replications; + private Webhooks webhooks; + private AgentPools agentPools; + private Runs runs; + private TaskRuns taskRuns; + private Tasks tasks; + private ScopeMaps scopeMaps; + private Tokens tokens; + /** + * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerRegistryManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerRegistryManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerRegistryManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerRegistry management API entry points that work across subscriptions + */ + ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(this); + } + return this.registries; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage PrivateEndpointConnections. + */ + public PrivateEndpointConnections privateEndpointConnections() { + if (this.privateEndpointConnections == null) { + this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); + } + return this.privateEndpointConnections; + } + + /** + * @return Entry point to manage Replications. + */ + public Replications replications() { + if (this.replications == null) { + this.replications = new ReplicationsImpl(this); + } + return this.replications; + } + + /** + * @return Entry point to manage Webhooks. + */ + public Webhooks webhooks() { + if (this.webhooks == null) { + this.webhooks = new WebhooksImpl(this); + } + return this.webhooks; + } + + /** + * @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 Runs. + */ + public Runs runs() { + if (this.runs == null) { + this.runs = new RunsImpl(this); + } + 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. + */ + public Tasks tasks() { + if (this.tasks == null) { + this.tasks = new TasksImpl(this); + } + return this.tasks; + } + + /** + * @return Entry point to manage ScopeMaps. + */ + public ScopeMaps scopeMaps() { + if (this.scopeMaps == null) { + this.scopeMaps = new ScopeMapsImpl(this); + } + return this.scopeMaps; + } + + /** + * @return Entry point to manage Tokens. + */ + public Tokens tokens() { + if (this.tokens == null) { + this.tokens = new TokensImpl(this); + } + return this.tokens; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerRegistryManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerRegistryManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerRegistryManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventImpl.java new file mode 100644 index 000000000000..9c1ae0fcf6c5 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventImpl.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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Event; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.EventResponseMessage; + +class EventImpl extends WrapperImpl implements Event { + private final ContainerRegistryManager manager; + EventImpl(EventInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public EventRequestMessage eventRequestMessage() { + return this.inner().eventRequestMessage(); + } + + @Override + public EventResponseMessage eventResponseMessage() { + return this.inner().eventResponseMessage(); + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInfoImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInfoImpl.java new file mode 100644 index 000000000000..df6441b2e374 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInfoImpl.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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.EventInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EventInfoImpl extends WrapperImpl implements EventInfo { + private final ContainerRegistryManager manager; + EventInfoImpl(EventInfoInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInfoInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInfoInner.java new file mode 100644 index 000000000000..beb8b5b38d87 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInfoInner.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_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The basic information of an event. + */ +public class EventInfoInner { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventInfoInner object itself. + */ + public EventInfoInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInner.java new file mode 100644 index 000000000000..faf9351d3fa4 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/EventInner.java @@ -0,0 +1,71 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.EventResponseMessage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event for a webhook. + */ +public class EventInner extends EventInfoInner { + /** + * The event request message sent to the service URI. + */ + @JsonProperty(value = "eventRequestMessage") + private EventRequestMessage eventRequestMessage; + + /** + * The event response message received from the service URI. + */ + @JsonProperty(value = "eventResponseMessage") + private EventResponseMessage eventResponseMessage; + + /** + * Get the event request message sent to the service URI. + * + * @return the eventRequestMessage value + */ + public EventRequestMessage eventRequestMessage() { + return this.eventRequestMessage; + } + + /** + * Set the event request message sent to the service URI. + * + * @param eventRequestMessage the eventRequestMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventRequestMessage(EventRequestMessage eventRequestMessage) { + this.eventRequestMessage = eventRequestMessage; + return this; + } + + /** + * Get the event response message received from the service URI. + * + * @return the eventResponseMessage value + */ + public EventResponseMessage eventResponseMessage() { + return this.eventResponseMessage; + } + + /** + * Set the event response message received from the service URI. + * + * @param eventResponseMessage the eventResponseMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventResponseMessage(EventResponseMessage eventResponseMessage) { + this.eventResponseMessage = eventResponseMessage; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/GenerateCredentialsResultImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/GenerateCredentialsResultImpl.java new file mode 100644 index 000000000000..dc8f42a3cc0e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/GenerateCredentialsResultImpl.java @@ -0,0 +1,38 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.GenerateCredentialsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TokenPassword; + +class GenerateCredentialsResultImpl extends WrapperImpl implements GenerateCredentialsResult { + private final ContainerRegistryManager manager; + GenerateCredentialsResultImpl(GenerateCredentialsResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List passwords() { + return this.inner().passwords(); + } + + @Override + public String username() { + return this.inner().username(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/GenerateCredentialsResultInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/GenerateCredentialsResultInner.java new file mode 100644 index 000000000000..b5b9465ee55d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/GenerateCredentialsResultInner.java @@ -0,0 +1,71 @@ +/** + * 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_12_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TokenPassword; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the GenerateCredentials operation. + */ +public class GenerateCredentialsResultInner { + /** + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username for a container registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for a container registry. + * + * @param username the username value to set + * @return the GenerateCredentialsResultInner object itself. + */ + public GenerateCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the list of passwords for a container registry. + * + * @return the passwords value + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the list of passwords for a container registry. + * + * @param passwords the passwords value to set + * @return the GenerateCredentialsResultInner object itself. + */ + public GenerateCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/IdParsingUtils.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 000000000000..f1e7deb0d2d6 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * 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_12_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationDefinitionImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationDefinitionImpl.java new file mode 100644 index 000000000000..eadda5268c49 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationDefinitionImpl.java @@ -0,0 +1,48 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.OperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.OperationDisplayDefinition; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.OperationServiceSpecificationDefinition; + +class OperationDefinitionImpl extends WrapperImpl implements OperationDefinition { + private final ContainerRegistryManager manager; + OperationDefinitionImpl(OperationDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public OperationDisplayDefinition display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String origin() { + return this.inner().origin(); + } + + @Override + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.inner().serviceSpecification(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationDefinitionInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationDefinitionInner.java new file mode 100644 index 000000000000..bec449682568 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationDefinitionInner.java @@ -0,0 +1,125 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.OperationDisplayDefinition; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.OperationServiceSpecificationDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The definition of a container registry operation. + */ +@JsonFlatten +public class OperationDefinitionInner { + /** + * The origin information of the container registry operation. + */ + @JsonProperty(value = "origin") + private String origin; + + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /** + * The definition of Azure Monitoring service. + */ + @JsonProperty(value = "properties.serviceSpecification") + private OperationServiceSpecificationDefinition serviceSpecification; + + /** + * Get the origin information of the container registry operation. + * + * @return the origin value + */ + public String origin() { + return this.origin; + } + + /** + * Set the origin information of the container registry operation. + * + * @param origin the origin value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withOrigin(String origin) { + this.origin = origin; + return this; + } + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information for the container registry operation. + * + * @return the display value + */ + public OperationDisplayDefinition display() { + return this.display; + } + + /** + * Set the display information for the container registry operation. + * + * @param display the display value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { + this.display = display; + return this; + } + + /** + * Get the definition of Azure Monitoring service. + * + * @return the serviceSpecification value + */ + public OperationServiceSpecificationDefinition serviceSpecification() { + return this.serviceSpecification; + } + + /** + * Set the definition of Azure Monitoring service. + * + * @param serviceSpecification the serviceSpecification value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withServiceSpecification(OperationServiceSpecificationDefinition serviceSpecification) { + this.serviceSpecification = serviceSpecification; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationsImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationsImpl.java new file mode 100644 index 000000000000..b183f6ad7e1f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * 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. + * abc + */ + +package com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.OperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerRegistryManager manager; + + OperationsImpl(ContainerRegistryManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationDefinition call(OperationDefinitionInner inner) { + return new OperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationsInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationsInner.java new file mode 100644 index 000000000000..ef36d75d0f99 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/OperationsInner.java @@ -0,0 +1,281 @@ +/** + * 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_12_01_preview.implementation; + +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.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +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 Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerRegistry/operations") + Observable> list(@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_12_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<OperationDefinitionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .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 of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2019-12-01-preview"; + return service.list(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 CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> 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 of the available Azure Container Registry REST API operations. + * + * @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 of the available Azure Container Registry REST API operations. + * + * @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<OperationDefinitionInner> 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 of the available Azure Container Registry REST API operations. + * + * @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<OperationDefinitionInner> 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 of the available Azure Container Registry REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PageImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PageImpl.java new file mode 100644 index 000000000000..8a9abd57aa0c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * 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_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionImpl.java new file mode 100644 index 000000000000..6e0e09f9228f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionImpl.java @@ -0,0 +1,124 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateEndpointConnection; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateLinkServiceConnectionState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; + +class PrivateEndpointConnectionImpl extends CreatableUpdatableImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String privateEndpointConnectionName; + + PrivateEndpointConnectionImpl(String name, ContainerRegistryManager manager) { + super(name, new PrivateEndpointConnectionInner()); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = name; + // + } + + PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.privateEndpointConnectionName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.privateEndpointConnectionName = IdParsingUtils.getValueFromIdByName(inner.id(), "privateEndpointConnections"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.registryName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.createOrUpdateAsync(this.resourceGroupName, this.registryName, this.privateEndpointConnectionName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + PrivateEndpointConnectionsInner client = this.manager().inner().privateEndpointConnections(); + return client.getAsync(this.resourceGroupName, this.registryName, this.privateEndpointConnectionName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PrivateEndpoint privateEndpoint() { + return this.inner().privateEndpoint(); + } + + @Override + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.inner().privateLinkServiceConnectionState(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public PrivateEndpointConnectionImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.inner().withPrivateEndpoint(privateEndpoint); + return this; + } + + @Override + public PrivateEndpointConnectionImpl withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.inner().withPrivateLinkServiceConnectionState(privateLinkServiceConnectionState); + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionInner.java new file mode 100644 index 000000000000..3fdfc730b4bb --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionInner.java @@ -0,0 +1,94 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateEndpoint; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateLinkServiceConnectionState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An object that represents a private endpoint connection for a container + * registry. + */ +@JsonFlatten +public class PrivateEndpointConnectionInner extends ProxyResource { + /** + * The resource of private endpoint. + */ + @JsonProperty(value = "properties.privateEndpoint") + private PrivateEndpoint privateEndpoint; + + /** + * A collection of information about the state of the connection between + * service consumer and provider. + */ + @JsonProperty(value = "properties.privateLinkServiceConnectionState") + private PrivateLinkServiceConnectionState privateLinkServiceConnectionState; + + /** + * The provisioning state of private endpoint connection resource. Possible + * values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', + * 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the resource of private endpoint. + * + * @return the privateEndpoint value + */ + public PrivateEndpoint privateEndpoint() { + return this.privateEndpoint; + } + + /** + * Set the resource of private endpoint. + * + * @param privateEndpoint the privateEndpoint value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateEndpoint(PrivateEndpoint privateEndpoint) { + this.privateEndpoint = privateEndpoint; + return this; + } + + /** + * Get a collection of information about the state of the connection between service consumer and provider. + * + * @return the privateLinkServiceConnectionState value + */ + public PrivateLinkServiceConnectionState privateLinkServiceConnectionState() { + return this.privateLinkServiceConnectionState; + } + + /** + * Set a collection of information about the state of the connection between service consumer and provider. + * + * @param privateLinkServiceConnectionState the privateLinkServiceConnectionState value to set + * @return the PrivateEndpointConnectionInner object itself. + */ + public PrivateEndpointConnectionInner withPrivateLinkServiceConnectionState(PrivateLinkServiceConnectionState privateLinkServiceConnectionState) { + this.privateLinkServiceConnectionState = privateLinkServiceConnectionState; + return this; + } + + /** + * Get the provisioning state of private endpoint connection resource. 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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionsImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionsImpl.java new file mode 100644 index 000000000000..351551b6616d --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionsImpl.java @@ -0,0 +1,85 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateEndpointConnections; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateEndpointConnection; + +class PrivateEndpointConnectionsImpl extends WrapperImpl implements PrivateEndpointConnections { + private final ContainerRegistryManager manager; + + PrivateEndpointConnectionsImpl(ContainerRegistryManager manager) { + super(manager.inner().privateEndpointConnections()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public PrivateEndpointConnectionImpl define(String name) { + return wrapModel(name); + } + + private PrivateEndpointConnectionImpl wrapModel(PrivateEndpointConnectionInner inner) { + return new PrivateEndpointConnectionImpl(inner, manager()); + } + + private PrivateEndpointConnectionImpl wrapModel(String name) { + return new PrivateEndpointConnectionImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + PrivateEndpointConnectionsInner 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 PrivateEndpointConnection call(PrivateEndpointConnectionInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, privateEndpointConnectionName) + .flatMap(new Func1>() { + @Override + public Observable call(PrivateEndpointConnectionInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((PrivateEndpointConnection)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + PrivateEndpointConnectionsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, privateEndpointConnectionName).toCompletable(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionsInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionsInner.java new file mode 100644 index 000000000000..ebdcd1b240e3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateEndpointConnectionsInner.java @@ -0,0 +1,764 @@ +/** + * 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_12_01_preview.implementation; + +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.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.Path; +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 PrivateEndpointConnections. + */ +public class PrivateEndpointConnectionsInner { + /** The Retrofit service to perform REST calls. */ + private PrivateEndpointConnectionsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of PrivateEndpointConnectionsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public PrivateEndpointConnectionsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(PrivateEndpointConnectionsService.class); + this.client = client; + } + + /** + * The interface defining all the services for PrivateEndpointConnections to be + * used by Retrofit to perform actually REST calls. + */ + interface PrivateEndpointConnectionsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateEndpointConnections get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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_12_01_preview.PrivateEndpointConnections createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionInner privateEndpointConnection, @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_12_01_preview.PrivateEndpointConnections beginCreateOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}") + Observable> beginCreateOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @Query("api-version") String apiVersion, @Body PrivateEndpointConnectionInner privateEndpointConnection, @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_12_01_preview.PrivateEndpointConnections delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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_12_01_preview.PrivateEndpointConnections beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("privateEndpointConnectionName") String privateEndpointConnectionName, @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_12_01_preview.PrivateEndpointConnections list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections") + 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_12_01_preview.PrivateEndpointConnections listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Get the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner get(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Get the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @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 privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Get the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner createOrUpdate(String resourceGroupName, String registryName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().last().body(); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @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 createOrUpdateAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createOrUpdateAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null."); + } + Validator.validate(privateEndpointConnection); + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, apiVersion, privateEndpointConnection, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PrivateEndpointConnectionInner object if successful. + */ + public PrivateEndpointConnectionInner beginCreateOrUpdate(String resourceGroupName, String registryName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection).toBlocking().single().body(); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @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 beginCreateOrUpdateAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection), serviceCallback); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable beginCreateOrUpdateAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection).map(new Func1, PrivateEndpointConnectionInner>() { + @Override + public PrivateEndpointConnectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update the state of specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @param privateEndpointConnection The parameters for creating a private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PrivateEndpointConnectionInner object + */ + public Observable> beginCreateOrUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName, PrivateEndpointConnectionInner privateEndpointConnection) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + if (privateEndpointConnection == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnection is required and cannot be null."); + } + Validator.validate(privateEndpointConnection); + final String apiVersion = "2019-12-01-preview"; + return service.beginCreateOrUpdate(this.client.subscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, apiVersion, privateEndpointConnection, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateOrUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 privateEndpointConnectionName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName).toBlocking().last().body(); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @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 privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 privateEndpointConnectionName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName).toBlocking().single().body(); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @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 privateEndpointConnectionName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName), serviceCallback); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, privateEndpointConnectionName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes the specified private endpoint connection associated with the 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 privateEndpointConnectionName The name of the private endpoint connection. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String privateEndpointConnectionName) { + 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 (privateEndpointConnectionName == null) { + throw new IllegalArgumentException("Parameter privateEndpointConnectionName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, 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 CloudException, 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) + .build(response); + } + + /** + * List all private endpoint connections in a 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 CloudException 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<PrivateEndpointConnectionInner> 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(); + } + }; + } + + /** + * List all private endpoint connections in a 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); + } + + /** + * List all private endpoint connections in a 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<PrivateEndpointConnectionInner> 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(); + } + }); + } + + /** + * List all private endpoint connections in a 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<PrivateEndpointConnectionInner> 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)); + } + }); + } + + /** + * List all private endpoint connections in a 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<PrivateEndpointConnectionInner> 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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * List all private endpoint connections in a container registry. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateEndpointConnectionInner> 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(); + } + }; + } + + /** + * List all private endpoint connections in a 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); + } + + /** + * List all private endpoint connections in a 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<PrivateEndpointConnectionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all private endpoint connections in a 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<PrivateEndpointConnectionInner> 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)); + } + }); + } + + /** + * List all private endpoint connections in a 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<PrivateEndpointConnectionInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateLinkResourceImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateLinkResourceImpl.java new file mode 100644 index 000000000000..8fce5e8674fb --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateLinkResourceImpl.java @@ -0,0 +1,61 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateLinkResource; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import rx.Observable; +import java.util.List; + +class PrivateLinkResourceImpl extends WrapperImpl implements PrivateLinkResource { + private final ContainerRegistryManager manager; + + PrivateLinkResourceImpl(PrivateLinkResourceInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + + + @Override + public String groupId() { + return this.inner().groupId(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List requiredMembers() { + return this.inner().requiredMembers(); + } + + @Override + public List requiredZoneNames() { + return this.inner().requiredZoneNames(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateLinkResourceInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateLinkResourceInner.java new file mode 100644 index 000000000000..8e350cf6ae81 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/PrivateLinkResourceInner.java @@ -0,0 +1,165 @@ +/** + * 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_12_01_preview.implementation; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * A resource that supports private link capabilities. + */ +@JsonFlatten +public class PrivateLinkResourceInner { + /** + * The resource type is private link resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * The resource ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The name of the resource. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The private link resource group id. + */ + @JsonProperty(value = "properties.groupId") + private String groupId; + + /** + * The private link resource required member names. + */ + @JsonProperty(value = "properties.requiredMembers") + private List requiredMembers; + + /** + * The private link resource Private link DNS zone name. + */ + @JsonProperty(value = "properties.requiredZoneNames") + private List requiredZoneNames; + + /** + * Get the resource type is private link resource. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Get the resource ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID. + * + * @param id the id value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name of the resource. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the resource. + * + * @param name the name value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the private link resource group id. + * + * @return the groupId value + */ + public String groupId() { + return this.groupId; + } + + /** + * Set the private link resource group id. + * + * @param groupId the groupId value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withGroupId(String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Get the private link resource required member names. + * + * @return the requiredMembers value + */ + public List requiredMembers() { + return this.requiredMembers; + } + + /** + * Set the private link resource required member names. + * + * @param requiredMembers the requiredMembers value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredMembers(List requiredMembers) { + this.requiredMembers = requiredMembers; + return this; + } + + /** + * Get the private link resource Private link DNS zone name. + * + * @return the requiredZoneNames value + */ + public List requiredZoneNames() { + return this.requiredZoneNames; + } + + /** + * Set the private link resource Private link DNS zone name. + * + * @param requiredZoneNames the requiredZoneNames value to set + * @return the PrivateLinkResourceInner object itself. + */ + public PrivateLinkResourceInner withRequiredZoneNames(List requiredZoneNames) { + this.requiredZoneNames = requiredZoneNames; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistriesImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistriesImpl.java new file mode 100644 index 000000000000..1009794184a2 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistriesImpl.java @@ -0,0 +1,261 @@ +/** + * 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. + * def + */ + +package com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Registries; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Registry; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryListCredentialsResult; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Run; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.SourceUploadDefinition; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.GenerateCredentialsResult; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryNameStatus; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ImportImageParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PasswordName; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunRequest; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.GenerateCredentialsParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryUsageListResult; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateLinkResource; + +class RegistriesImpl extends GroupableResourcesCoreImpl implements Registries { + protected RegistriesImpl(ContainerRegistryManager manager) { + super(manager.inner().registries(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RegistriesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RegistriesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RegistriesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RegistriesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RegistryImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + RegistriesInner client = this.inner(); + return client.importImageAsync(resourceGroupName, registryName, parameters).toCompletable(); + } + + @Override + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listCredentialsAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + RegistriesInner client = this.inner(); + return client.regenerateCredentialAsync(resourceGroupName, registryName, name) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + RegistriesInner client = this.inner(); + return client.scheduleRunAsync(resourceGroupName, registryName, runRequest) + .map(new Func1() { + @Override + public Run call(RunInner inner) { + return new RunImpl(inner, manager()); + } + }); + } + + @Override + public Observable getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.getBuildSourceUploadUrlAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public SourceUploadDefinition call(SourceUploadDefinitionInner inner) { + return new SourceUploadDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable generateCredentialsAsync(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + RegistriesInner client = this.inner(); + return client.generateCredentialsAsync(resourceGroupName, registryName, generateCredentialsParameters) + .map(new Func1() { + @Override + public GenerateCredentialsResult call(GenerateCredentialsResultInner inner) { + return new GenerateCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + RegistriesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public RegistryNameStatus call(RegistryNameStatusInner inner) { + return new RegistryNameStatusImpl(inner, manager()); + } + }); + } + + @Override + protected RegistryImpl wrapModel(RegistryInner inner) { + return new RegistryImpl(inner.name(), inner, manager()); + } + + @Override + protected RegistryImpl wrapModel(String name) { + return new RegistryImpl(name, new RegistryInner(), this.manager()); + } + + private PrivateLinkResourceImpl wrapPrivateLinkResourceModel(PrivateLinkResourceInner inner) { + return new PrivateLinkResourceImpl(inner, manager()); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryUsageListResult call(RegistryUsageListResultInner inner) { + return new RegistryUsageListResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable listPrivateLinkResourcesAsync(final String resourceGroupName, final String registryName) { + RegistriesInner client = this.inner(); + return client.listPrivateLinkResourcesAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public PrivateLinkResource call(PrivateLinkResourceInner inner) { + return wrapPrivateLinkResourceModel(inner); + } + }); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistriesInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistriesInner.java new file mode 100644 index 000000000000..243205655799 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistriesInner.java @@ -0,0 +1,2344 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +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_12_01_preview.ErrorSchemaException; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.GenerateCredentialsParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ImportImageParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PasswordName; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegenerateCredentialParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryNameCheckRequest; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunRequest; +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 Registries. + */ +public class RegistriesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RegistriesService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RegistriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Registries to be + * used by Retrofit to perform actually REST calls. + */ + interface RegistriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Registries importImage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage") + Observable> importImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body ImportImageParameters parameters, @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_12_01_preview.Registries beginImportImage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage") + Observable> beginImportImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body ImportImageParameters parameters, @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_12_01_preview.Registries checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegistryNameCheckRequest registryNameCheckRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Registries getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> getByResourceGroup(@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_12_01_preview.Registries create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @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_12_01_preview.Registries beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @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_12_01_preview.Registries delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> delete(@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_12_01_preview.Registries beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@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_12_01_preview.Registries update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @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_12_01_preview.Registries beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @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_12_01_preview.Registries listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @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_12_01_preview.Registries list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + Observable> list(@Path("subscriptionId") String subscriptionId, @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_12_01_preview.Registries listCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials") + Observable> listCredentials(@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_12_01_preview.Registries regenerateCredential" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential") + Observable> regenerateCredential(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateCredentialParameters regenerateCredentialParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Registries listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages") + Observable> listUsages(@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_12_01_preview.Registries listPrivateLinkResources" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateLinkResources") + Observable> listPrivateLinkResources(@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_12_01_preview.Registries scheduleRun" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") + Observable> scheduleRun(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RunRequest runRequest, @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_12_01_preview.Registries beginScheduleRun" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") + Observable> beginScheduleRun(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RunRequest runRequest, @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_12_01_preview.Registries getBuildSourceUploadUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl") + Observable> getBuildSourceUploadUrl(@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_12_01_preview.Registries generateCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/generateCredentials") + Observable> generateCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body GenerateCredentialsParameters generateCredentialsParameters, @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_12_01_preview.Registries beginGenerateCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/generateCredentials") + Observable> beginGenerateCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body GenerateCredentialsParameters generateCredentialsParameters, @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_12_01_preview.Registries listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @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_12_01_preview.Registries listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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_12_01_preview.Registries listPrivateLinkResourcesNext" }) + @GET + Observable> listPrivateLinkResourcesNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().last().body(); + } + + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source 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 importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters), serviceCallback); + } + + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + return importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> importImageWithServiceResponseAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.importImage(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginImportImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().single().body(); + } + + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source 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 beginImportImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters), serviceCallback); + } + + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginImportImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + return beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies an image to this container registry from the 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 parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginImportImageWithServiceResponseAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + 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 (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2019-12-01-preview"; + return service.beginImportImage(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginImportImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginImportImageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name 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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryNameStatusInner object if successful. + */ + public RegistryNameStatusInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name 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 checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, RegistryNameStatusInner>() { + @Override + public RegistryNameStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); + registryNameCheckRequest.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), registryNameCheckRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the properties of the 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 getByResourceGroupAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the properties of the 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 RegistryInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the 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 RegistryInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, 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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates 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 registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().last().body(); + } + + /** + * Creates 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 registry The parameters for creating a 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 createAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates 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 registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates 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 registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + 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 (registry == null) { + throw new IllegalArgumentException("Parameter registry is required and cannot be null."); + } + Validator.validate(registry); + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registry, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates 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 registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginCreate(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().single().body(); + } + + /** + * Creates 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 registry The parameters for creating a 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 beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates 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 registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates 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 registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + 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 (registry == null) { + throw new IllegalArgumentException("Parameter registry is required and cannot be null."); + } + Validator.validate(registry); + final String apiVersion = "2019-12-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registry, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a 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 CloudException 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) { + deleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().last().body(); + } + + /** + * Deletes a 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 deleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a 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 + */ + public Observable deleteAsync(String resourceGroupName, String registryName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a 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 + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, 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."); + } + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a 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 CloudException 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) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Deletes a 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 beginDeleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a 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 {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a 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 {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, 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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, 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 CloudException, 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) + .build(response); + } + + /** + * Updates 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 registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner update(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates 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 registryUpdateParameters The parameters for updating a 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 updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates 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 registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates 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 registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + 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 (registryUpdateParameters == null) { + throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); + } + Validator.validate(registryUpdateParameters); + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates 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 registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginUpdate(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates 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 registryUpdateParameters The parameters for updating a 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 beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates 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 registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates 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 registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + 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 (registryUpdateParameters == null) { + throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); + } + Validator.validate(registryUpdateParameters); + final String apiVersion = "2019-12-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registryUpdateParameters, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<RegistryInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @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> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + 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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<RegistryInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @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 ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .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 container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.list(this.client.subscriptionId(), 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the login credentials for the 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Lists the login credentials for the 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 listCredentialsAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCredentialsWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Lists the login credentials for the 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 RegistryListCredentialsResultInner object + */ + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the login credentials for the 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 RegistryListCredentialsResultInner object + */ + public Observable> listCredentialsWithServiceResponseAsync(String resourceGroupName, 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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.listCredentials(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates one of the login credentials for the 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 name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner regenerateCredential(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).toBlocking().single().body(); + } + + /** + * Regenerates one of the login credentials for the 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 name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @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 regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name), serviceCallback); + } + + /** + * Regenerates one of the login credentials for the 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 name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the login credentials for the 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 name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> regenerateCredentialWithServiceResponseAsync(String resourceGroupName, String registryName, PasswordName name) { + 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 (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters(); + regenerateCredentialParameters.withName(name); + return service.regenerateCredential(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), regenerateCredentialParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateCredentialDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateCredentialDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the quota usages for the 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 CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryUsageListResultInner object if successful. + */ + public RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the quota usages for the 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 listUsagesAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the quota usages for the 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 RegistryUsageListResultInner object + */ + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryUsageListResultInner>() { + @Override + public RegistryUsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the quota usages for the 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 RegistryUsageListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String resourceGroupName, 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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.listUsages(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the private link resources for a 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 CloudException 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<PrivateLinkResourceInner> object if successful. + */ + public PagedList listPrivateLinkResources(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listPrivateLinkResourcesSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPrivateLinkResourcesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the private link resources for a 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> listPrivateLinkResourcesAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPrivateLinkResourcesSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPrivateLinkResourcesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the private link resources for a 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<PrivateLinkResourceInner> object + */ + public Observable> listPrivateLinkResourcesAsync(final String resourceGroupName, final String registryName) { + return listPrivateLinkResourcesWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the private link resources for a 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<PrivateLinkResourceInner> object + */ + public Observable>> listPrivateLinkResourcesWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listPrivateLinkResourcesSinglePageAsync(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(listPrivateLinkResourcesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the private link resources for a 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<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPrivateLinkResourcesSinglePageAsync(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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.listPrivateLinkResources(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPrivateLinkResourcesDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPrivateLinkResourcesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).toBlocking().last().body(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param 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 scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest), serviceCallback); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> scheduleRunWithServiceResponseAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + 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 (runRequest == null) { + throw new IllegalArgumentException("Parameter runRequest is required and cannot be null."); + } + Validator.validate(runRequest); + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.scheduleRun(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, runRequest, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public RunInner beginScheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + return beginScheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).toBlocking().single().body(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @param 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 beginScheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginScheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest), serviceCallback); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable beginScheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + return beginScheduleRunWithServiceResponseAsync(resourceGroupName, registryName, runRequest).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable> beginScheduleRunWithServiceResponseAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + 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 (runRequest == null) { + throw new IllegalArgumentException("Parameter runRequest is required and cannot be null."); + } + Validator.validate(runRequest); + final String apiVersion = "2019-06-01-preview"; + return service.beginScheduleRun(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, runRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginScheduleRunDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginScheduleRunDelegate(Response response) throws ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the SourceUploadDefinitionInner object if successful. + */ + public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param 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 getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getBuildSourceUploadUrlWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SourceUploadDefinitionInner object + */ + public Observable getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, SourceUploadDefinitionInner>() { + @Override + public SourceUploadDefinitionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SourceUploadDefinitionInner object + */ + public Observable> getBuildSourceUploadUrlWithServiceResponseAsync(String resourceGroupName, 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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.getBuildSourceUploadUrl(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getBuildSourceUploadUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getBuildSourceUploadUrlDelegate(Response response) throws ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GenerateCredentialsResultInner object if successful. + */ + public GenerateCredentialsResultInner generateCredentials(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + return generateCredentialsWithServiceResponseAsync(resourceGroupName, registryName, generateCredentialsParameters).toBlocking().last().body(); + } + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @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 generateCredentialsAsync(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(generateCredentialsWithServiceResponseAsync(resourceGroupName, registryName, generateCredentialsParameters), serviceCallback); + } + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable generateCredentialsAsync(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + return generateCredentialsWithServiceResponseAsync(resourceGroupName, registryName, generateCredentialsParameters).map(new Func1, GenerateCredentialsResultInner>() { + @Override + public GenerateCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> generateCredentialsWithServiceResponseAsync(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + 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 (generateCredentialsParameters == null) { + throw new IllegalArgumentException("Parameter generateCredentialsParameters is required and cannot be null."); + } + Validator.validate(generateCredentialsParameters); + final String apiVersion = "2019-05-01-preview"; + Observable> observable = service.generateCredentials(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, generateCredentialsParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the GenerateCredentialsResultInner object if successful. + */ + public GenerateCredentialsResultInner beginGenerateCredentials(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + return beginGenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName, generateCredentialsParameters).toBlocking().single().body(); + } + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @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 beginGenerateCredentialsAsync(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginGenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName, generateCredentialsParameters), serviceCallback); + } + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GenerateCredentialsResultInner object + */ + public Observable beginGenerateCredentialsAsync(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + return beginGenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName, generateCredentialsParameters).map(new Func1, GenerateCredentialsResultInner>() { + @Override + public GenerateCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Generate keys for a token of 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 generateCredentialsParameters The parameters for generating credentials. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the GenerateCredentialsResultInner object + */ + public Observable> beginGenerateCredentialsWithServiceResponseAsync(String resourceGroupName, String registryName, GenerateCredentialsParameters generateCredentialsParameters) { + 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 (generateCredentialsParameters == null) { + throw new IllegalArgumentException("Parameter generateCredentialsParameters is required and cannot be null."); + } + Validator.validate(generateCredentialsParameters); + final String apiVersion = "2019-05-01-preview"; + return service.beginGenerateCredentials(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, generateCredentialsParameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginGenerateCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginGenerateCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @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> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @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<RegistryInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @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<RegistryInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(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(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> 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 container registries under the specified subscription. + * + * @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 container registries under the specified subscription. + * + * @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<RegistryInner> 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 container registries under the specified subscription. + * + * @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<RegistryInner> 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 container registries under the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the private link resources for a container registry. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<PrivateLinkResourceInner> object if successful. + */ + public PagedList listPrivateLinkResourcesNext(final String nextPageLink) { + ServiceResponse> response = listPrivateLinkResourcesNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listPrivateLinkResourcesNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists the private link resources for a 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> listPrivateLinkResourcesNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listPrivateLinkResourcesNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listPrivateLinkResourcesNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists the private link resources for a 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<PrivateLinkResourceInner> object + */ + public Observable> listPrivateLinkResourcesNextAsync(final String nextPageLink) { + return listPrivateLinkResourcesNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists the private link resources for a 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<PrivateLinkResourceInner> object + */ + public Observable>> listPrivateLinkResourcesNextWithServiceResponseAsync(final String nextPageLink) { + return listPrivateLinkResourcesNextSinglePageAsync(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(listPrivateLinkResourcesNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists the private link resources for a 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<PrivateLinkResourceInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listPrivateLinkResourcesNextSinglePageAsync(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.listPrivateLinkResourcesNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listPrivateLinkResourcesNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listPrivateLinkResourcesNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryImpl.java new file mode 100644 index 000000000000..39a67433ccf8 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryImpl.java @@ -0,0 +1,231 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Registry; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Sku; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.IdentityProperties; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Status1; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.StorageAccountProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.NetworkRuleSet; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Policies; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.EncryptionProperty; +import java.util.List; +import java.util.ArrayList; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PrivateEndpointConnection; +import rx.functions.Func1; + +class RegistryImpl extends GroupableResourceCoreImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryUpdateParameters updateParameter; + RegistryImpl(String name, RegistryInner inner, ContainerRegistryManager manager) { + super(name, inner, manager); + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Boolean adminUserEnabled() { + return this.inner().adminUserEnabled(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public Boolean dataEndpointEnabled() { + return this.inner().dataEndpointEnabled(); + } + + @Override + public List dataEndpointHostNames() { + return this.inner().dataEndpointHostNames(); + } + + @Override + public EncryptionProperty encryption() { + return this.inner().encryption(); + } + + @Override + public IdentityProperties identity() { + return this.inner().identity(); + } + + @Override + public String loginServer() { + return this.inner().loginServer(); + } + + @Override + public NetworkRuleSet networkRuleSet() { + return this.inner().networkRuleSet(); + } + + @Override + public Policies policies() { + return this.inner().policies(); + } + + @Override + public List privateEndpointConnections() { + List lst = new ArrayList(); + if (this.inner().privateEndpointConnections() != null) { + for (PrivateEndpointConnectionInner inner : this.inner().privateEndpointConnections()) { + lst.add( new PrivateEndpointConnectionImpl(inner, manager())); + } + } + return lst; + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Status1 status() { + return this.inner().status(); + } + + @Override + public StorageAccountProperties storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public RegistryImpl withStorageAccount(StorageAccountProperties storageAccount) { + this.inner().withStorageAccount(storageAccount); + return this; + } + + @Override + public RegistryImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.inner().withAdminUserEnabled(adminUserEnabled); + } else { + this.updateParameter.withAdminUserEnabled(adminUserEnabled); + } + return this; + } + + @Override + public RegistryImpl withDataEndpointEnabled(Boolean dataEndpointEnabled) { + if (isInCreateMode()) { + this.inner().withDataEndpointEnabled(dataEndpointEnabled); + } else { + this.updateParameter.withDataEndpointEnabled(dataEndpointEnabled); + } + return this; + } + + @Override + public RegistryImpl withEncryption(EncryptionProperty encryption) { + if (isInCreateMode()) { + this.inner().withEncryption(encryption); + } else { + this.updateParameter.withEncryption(encryption); + } + return this; + } + + @Override + public RegistryImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + + @Override + public RegistryImpl withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + if (isInCreateMode()) { + this.inner().withNetworkRuleSet(networkRuleSet); + } else { + this.updateParameter.withNetworkRuleSet(networkRuleSet); + } + return this; + } + + @Override + public RegistryImpl withPolicies(Policies policies) { + if (isInCreateMode()) { + this.inner().withPolicies(policies); + } else { + this.updateParameter.withPolicies(policies); + } + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryInner.java new file mode 100644 index 000000000000..26df18e729f4 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryInner.java @@ -0,0 +1,333 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Sku; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.IdentityProperties; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Status1; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.StorageAccountProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.NetworkRuleSet; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Policies; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.EncryptionProperty; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a container registry. + */ +@JsonFlatten +public class RegistryInner extends Resource { + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The identity of the container registry. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "properties.loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /** + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The provisioning state of the container registry at the time the + * operation was called. Possible values include: 'Creating', 'Updating', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the container registry at the time the operation was + * called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status1 status; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The properties of the storage account for the container registry. Only + * applicable to Classic SKU. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * The network rule set for a container registry. + */ + @JsonProperty(value = "properties.networkRuleSet") + private NetworkRuleSet networkRuleSet; + + /** + * The policies for a container registry. + */ + @JsonProperty(value = "properties.policies") + private Policies policies; + + /** + * The encryption settings of container registry. + */ + @JsonProperty(value = "properties.encryption") + private EncryptionProperty encryption; + + /** + * Enable a single data endpoint per region for serving data. + */ + @JsonProperty(value = "properties.dataEndpointEnabled") + private Boolean dataEndpointEnabled; + + /** + * List of host names that will serve data when dataEndpointEnabled is + * true. + */ + @JsonProperty(value = "properties.dataEndpointHostNames", access = JsonProperty.Access.WRITE_ONLY) + private List dataEndpointHostNames; + + /** + * List of private endpoint connections for a container registry. + */ + @JsonProperty(value = "properties.privateEndpointConnections", access = JsonProperty.Access.WRITE_ONLY) + private List privateEndpointConnections; + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the identity of the container registry. + * + * @return the identity value + */ + public IdentityProperties identity() { + return this.identity; + } + + /** + * Set the identity of the container registry. + * + * @param identity the identity value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the URL that can be used to log into the container registry. + * + * @return the loginServer value + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creation date of the container registry in ISO8601 format. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the container registry at the time the operation was called. + * + * @return the status value + */ + public Status1 status() { + return this.status; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the properties of the storage account for the container registry. Only applicable to Classic SKU. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the properties of the storage account for the container registry. Only applicable to Classic SKU. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + + /** + * Get the network rule set for a container registry. + * + * @return the networkRuleSet value + */ + public NetworkRuleSet networkRuleSet() { + return this.networkRuleSet; + } + + /** + * Set the network rule set for a container registry. + * + * @param networkRuleSet the networkRuleSet value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withNetworkRuleSet(NetworkRuleSet networkRuleSet) { + this.networkRuleSet = networkRuleSet; + return this; + } + + /** + * Get the policies for a container registry. + * + * @return the policies value + */ + public Policies policies() { + return this.policies; + } + + /** + * Set the policies for a container registry. + * + * @param policies the policies value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withPolicies(Policies policies) { + this.policies = policies; + return this; + } + + /** + * Get the encryption settings of container registry. + * + * @return the encryption value + */ + public EncryptionProperty encryption() { + return this.encryption; + } + + /** + * Set the encryption settings of container registry. + * + * @param encryption the encryption value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withEncryption(EncryptionProperty encryption) { + this.encryption = encryption; + return this; + } + + /** + * Get enable a single data endpoint per region for serving data. + * + * @return the dataEndpointEnabled value + */ + public Boolean dataEndpointEnabled() { + return this.dataEndpointEnabled; + } + + /** + * Set enable a single data endpoint per region for serving data. + * + * @param dataEndpointEnabled the dataEndpointEnabled value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withDataEndpointEnabled(Boolean dataEndpointEnabled) { + this.dataEndpointEnabled = dataEndpointEnabled; + return this; + } + + /** + * Get list of host names that will serve data when dataEndpointEnabled is true. + * + * @return the dataEndpointHostNames value + */ + public List dataEndpointHostNames() { + return this.dataEndpointHostNames; + } + + /** + * Get list of private endpoint connections for a container registry. + * + * @return the privateEndpointConnections value + */ + public List privateEndpointConnections() { + return this.privateEndpointConnections; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryListCredentialsResultImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryListCredentialsResultImpl.java new file mode 100644 index 000000000000..a779c0776a82 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryListCredentialsResultImpl.java @@ -0,0 +1,38 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryListCredentialsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryPassword; + +class RegistryListCredentialsResultImpl extends WrapperImpl implements RegistryListCredentialsResult { + private final ContainerRegistryManager manager; + RegistryListCredentialsResultImpl(RegistryListCredentialsResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List passwords() { + return this.inner().passwords(); + } + + @Override + public String username() { + return this.inner().username(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryListCredentialsResultInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryListCredentialsResultInner.java new file mode 100644 index 000000000000..2f9199b27d53 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryListCredentialsResultInner.java @@ -0,0 +1,71 @@ +/** + * 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_12_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListCredentials operation. + */ +public class RegistryListCredentialsResultInner { + /** + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username for a container registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for a container registry. + * + * @param username the username value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the list of passwords for a container registry. + * + * @return the passwords value + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the list of passwords for a container registry. + * + * @param passwords the passwords value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryNameStatusImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryNameStatusImpl.java new file mode 100644 index 000000000000..9b1d6eb70ef3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryNameStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryNameStatusImpl extends WrapperImpl implements RegistryNameStatus { + private final ContainerRegistryManager manager; + RegistryNameStatusImpl(RegistryNameStatusInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryNameStatusInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryNameStatusInner.java new file mode 100644 index 000000000000..0c4bea2472e8 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryNameStatusInner.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_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to check the availability of a container registry + * name. + */ +public class RegistryNameStatusInner { + /** + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value that indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the value that indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get if any, the reason that the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set if any, the reason that the name is not available. + * + * @param reason the reason value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get if any, the error message that provides more detail for the reason that the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if any, the error message that provides more detail for the reason that the name is not available. + * + * @param message the message value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryUsageListResultImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryUsageListResultImpl.java new file mode 100644 index 000000000000..dbfb8cbd4016 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryUsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryUsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryUsage; + +class RegistryUsageListResultImpl extends WrapperImpl implements RegistryUsageListResult { + private final ContainerRegistryManager manager; + RegistryUsageListResultImpl(RegistryUsageListResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryUsageListResultInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryUsageListResultInner.java new file mode 100644 index 000000000000..f3b6e50993f9 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RegistryUsageListResultInner.java @@ -0,0 +1,45 @@ +/** + * 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_12_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RegistryUsage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to get container registry quota usages. + */ +public class RegistryUsageListResultInner { + /** + * The list of container registry quota usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of container registry quota usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of container registry quota usages. + * + * @param value the value value to set + * @return the RegistryUsageListResultInner object itself. + */ + public RegistryUsageListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationImpl.java new file mode 100644 index 000000000000..c03d47534796 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationImpl.java @@ -0,0 +1,129 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Replication; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Status1; + +class ReplicationImpl extends CreatableUpdatableImpl implements Replication, Replication.Definition, Replication.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String replicationName; + + ReplicationImpl(String name, ContainerRegistryManager manager) { + super(name, new ReplicationInner()); + this.manager = manager; + // Set resource name + this.replicationName = name; + // + } + + ReplicationImpl(ReplicationInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.replicationName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.replicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "replications"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.getAsync(this.resourceGroupName, this.registryName, this.replicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @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 ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Status1 status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ReplicationImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public ReplicationImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ReplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationInner.java new file mode 100644 index 000000000000..a8a8fc8f4850 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationInner.java @@ -0,0 +1,54 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Status1; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a replication for a container registry. + */ +@JsonFlatten +public class ReplicationInner extends Resource { + /** + * The provisioning state of the replication at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the replication at the time the operation was called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status1 status; + + /** + * Get the provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the replication at the time the operation was called. + * + * @return the status value + */ + public Status1 status() { + return this.status; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationsImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationsImpl.java new file mode 100644 index 000000000000..dd93b8a624bc --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationsImpl.java @@ -0,0 +1,85 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Replications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Replication; + +class ReplicationsImpl extends WrapperImpl implements Replications { + private final ContainerRegistryManager manager; + + ReplicationsImpl(ContainerRegistryManager manager) { + super(manager.inner().replications()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public ReplicationImpl define(String name) { + return wrapModel(name); + } + + private ReplicationImpl wrapModel(ReplicationInner inner) { + return new ReplicationImpl(inner, manager()); + } + + private ReplicationImpl wrapModel(String name) { + return new ReplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + ReplicationsInner 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 Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, replicationName) + .flatMap(new Func1>() { + @Override + public Observable call(ReplicationInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Replication)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, replicationName).toCompletable(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationsInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationsInner.java new file mode 100644 index 000000000000..ea52e352c788 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ReplicationsInner.java @@ -0,0 +1,1118 @@ +/** + * 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_12_01_preview.implementation; + +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_12_01_preview.ReplicationUpdateParameters; +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 java.util.Map; +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.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 Replications. + */ +public class ReplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ReplicationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReplicationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(ReplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Replications to be + * used by Retrofit to perform actually REST calls. + */ + interface ReplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Replications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @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_12_01_preview.Replications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @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_12_01_preview.Replications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @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_12_01_preview.Replications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @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_12_01_preview.Replications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @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_12_01_preview.Replications update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Replications beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Replications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications") + 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_12_01_preview.Replications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner get(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @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 replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a replication 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 replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner create(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().last().body(); + } + + /** + * Creates a replication 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 replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @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 replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication 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 replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication 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 replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (replication == null) { + throw new IllegalArgumentException("Parameter replication is required and cannot be null."); + } + Validator.validate(replication); + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, replication, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a replication 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 replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginCreate(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().single().body(); + } + + /** + * Creates a replication 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 replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @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 replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication 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 replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication 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 replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (replication == null) { + throw new IllegalArgumentException("Parameter replication is required and cannot be null."); + } + Validator.validate(replication); + final String apiVersion = "2019-12-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, replication, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a replication from a 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 replicationName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Deletes a replication from a 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 replicationName The name of the replication. + * @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 replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a replication from a 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 replicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Deletes a replication from a 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 replicationName The name of the replication. + * @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 replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String replicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, 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 CloudException, 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) + .build(response); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @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 replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + final Map tags = null; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a replication 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 replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().last().body(); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @param tags The tags for the replication. + * @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 replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-12-01-preview"; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(tags); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @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 replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + final Map tags = null; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, 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); + } + } + }); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().single().body(); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @param tags The tags for the replication. + * @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 replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication 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 replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + 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 (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "2019-12-01-preview"; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(tags); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the 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 CloudException 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<ReplicationInner> 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 replications for the 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 replications for the 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<ReplicationInner> 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 replications for the 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<ReplicationInner> 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 replications for the 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<ReplicationInner> 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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> 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 replications for the 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 replications for the 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<ReplicationInner> 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 replications for the 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<ReplicationInner> 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 replications for the 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<ReplicationInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunGetLogResultImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunGetLogResultImpl.java new file mode 100644 index 000000000000..8a1339e7887a --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunGetLogResultImpl.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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunGetLogResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RunGetLogResultImpl extends WrapperImpl implements RunGetLogResult { + private final ContainerRegistryManager manager; + RunGetLogResultImpl(RunGetLogResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String logLink() { + return this.inner().logLink(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunGetLogResultInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunGetLogResultInner.java new file mode 100644 index 000000000000..156e3b8494e5 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunGetLogResultInner.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_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of get log link operation. + */ +public class RunGetLogResultInner { + /** + * The link to logs for a run on a azure container registry. + */ + @JsonProperty(value = "logLink") + private String logLink; + + /** + * Get the link to logs for a run on a azure container registry. + * + * @return the logLink value + */ + public String logLink() { + return this.logLink; + } + + /** + * Set the link to logs for a run on a azure container registry. + * + * @param logLink the logLink value to set + * @return the RunGetLogResultInner object itself. + */ + public RunGetLogResultInner withLogLink(String logLink) { + this.logLink = logLink; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunImpl.java new file mode 100644 index 000000000000..7e7d497bc3e2 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunImpl.java @@ -0,0 +1,209 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Run; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.AgentProperties; +import org.joda.time.DateTime; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ImageUpdateTrigger; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ImageDescriptor; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunType; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.SourceTriggerDescriptor; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunStatus; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TimerTriggerDescriptor; + +class RunImpl extends CreatableUpdatableImpl implements Run, Run.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String runId; + private Boolean uisArchiveEnabled; + + RunImpl(String name, ContainerRegistryManager manager) { + super(name, new RunInner()); + this.manager = manager; + // Set resource name + this.runId = name; + // + } + + RunImpl(RunInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.runId = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.runId = IdParsingUtils.getValueFromIdByName(inner.id(), "runs"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + RunsInner client = this.manager().inner().runs(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + RunsInner client = this.manager().inner().runs(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.runId, this.uisArchiveEnabled) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RunsInner client = this.manager().inner().runs(); + return client.getAsync(this.resourceGroupName, this.registryName, this.runId); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public AgentProperties agentConfiguration() { + return this.inner().agentConfiguration(); + } + + @Override + public String agentPoolName() { + return this.inner().agentPoolName(); + } + + @Override + public DateTime createTime() { + return this.inner().createTime(); + } + + @Override + public List customRegistries() { + return this.inner().customRegistries(); + } + + @Override + public DateTime finishTime() { + return this.inner().finishTime(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ImageUpdateTrigger imageUpdateTrigger() { + return this.inner().imageUpdateTrigger(); + } + + @Override + public Boolean isArchiveEnabled() { + return this.inner().isArchiveEnabled(); + } + + @Override + public DateTime lastUpdatedTime() { + return this.inner().lastUpdatedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputImages() { + return this.inner().outputImages(); + } + + @Override + public PlatformProperties platform() { + return this.inner().platform(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String runErrorMessage() { + return this.inner().runErrorMessage(); + } + + @Override + public String runId() { + return this.inner().runId(); + } + + @Override + public RunType runType() { + return this.inner().runType(); + } + + @Override + public String sourceRegistryAuth() { + return this.inner().sourceRegistryAuth(); + } + + @Override + public SourceTriggerDescriptor sourceTrigger() { + return this.inner().sourceTrigger(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public RunStatus status() { + return this.inner().status(); + } + + @Override + public String task() { + return this.inner().task(); + } + + @Override + public TimerTriggerDescriptor timerTrigger() { + return this.inner().timerTrigger(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String updateTriggerToken() { + return this.inner().updateTriggerToken(); + } + + @Override + public RunImpl withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.uisArchiveEnabled = isArchiveEnabled; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunInner.java new file mode 100644 index 000000000000..0438a7a428b4 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunInner.java @@ -0,0 +1,574 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunType; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ImageDescriptor; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ImageUpdateTrigger; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.SourceTriggerDescriptor; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TimerTriggerDescriptor; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.AgentProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * Run resource properties. + */ +@JsonFlatten +public class RunInner extends ProxyResource { + /** + * The unique identifier for the run. + */ + @JsonProperty(value = "properties.runId") + private String runId; + + /** + * The current status of the run. Possible values include: 'Queued', + * 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', + * 'Timeout'. + */ + @JsonProperty(value = "properties.status") + private RunStatus status; + + /** + * The last updated time for the run. + */ + @JsonProperty(value = "properties.lastUpdatedTime") + private DateTime lastUpdatedTime; + + /** + * The type of run. Possible values include: 'QuickBuild', 'QuickRun', + * 'AutoBuild', 'AutoRun'. + */ + @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. + */ + @JsonProperty(value = "properties.createTime") + private DateTime createTime; + + /** + * The time the run started. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The time the run finished. + */ + @JsonProperty(value = "properties.finishTime") + private DateTime finishTime; + + /** + * The list of all images that were generated from the run. This is + * applicable if the run generates base image dependencies. + */ + @JsonProperty(value = "properties.outputImages") + private List outputImages; + + /** + * The task against which run was scheduled. + */ + @JsonProperty(value = "properties.task") + private String task; + + /** + * The image update trigger that caused the run. This is applicable if the + * task has base image trigger configured. + */ + @JsonProperty(value = "properties.imageUpdateTrigger") + private ImageUpdateTrigger imageUpdateTrigger; + + /** + * The source trigger that caused the run. + */ + @JsonProperty(value = "properties.sourceTrigger") + private SourceTriggerDescriptor sourceTrigger; + + /** + * The timer trigger that caused the run. + */ + @JsonProperty(value = "properties.timerTrigger") + private TimerTriggerDescriptor timerTrigger; + + /** + * The platform properties against which the run will happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @JsonProperty(value = "properties.agentConfiguration") + private AgentProperties agentConfiguration; + + /** + * The scope of the credentials that were used to login to the source + * registry during this run. + */ + @JsonProperty(value = "properties.sourceRegistryAuth") + private String sourceRegistryAuth; + + /** + * The list of custom registries that were logged in during this run. + */ + @JsonProperty(value = "properties.customRegistries") + private List customRegistries; + + /** + * The error message received from backend systems after the run is + * scheduled. + */ + @JsonProperty(value = "properties.runErrorMessage", access = JsonProperty.Access.WRITE_ONLY) + private String runErrorMessage; + + /** + * The update trigger token passed for the Run. + */ + @JsonProperty(value = "properties.updateTriggerToken") + private String updateTriggerToken; + + /** + * The provisioning state of a run. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "properties.isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * Get the unique identifier for the run. + * + * @return the runId value + */ + public String runId() { + return this.runId; + } + + /** + * Set the unique identifier for the run. + * + * @param runId the runId value to set + * @return the RunInner object itself. + */ + public RunInner withRunId(String runId) { + this.runId = runId; + return this; + } + + /** + * Get the current status of the run. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @return the status value + */ + public RunStatus status() { + return this.status; + } + + /** + * Set the current status of the run. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @param status the status value to set + * @return the RunInner object itself. + */ + public RunInner withStatus(RunStatus status) { + this.status = status; + return this; + } + + /** + * Get the last updated time for the run. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the last updated time for the run. + * + * @param lastUpdatedTime the lastUpdatedTime value to set + * @return the RunInner object itself. + */ + public RunInner withLastUpdatedTime(DateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'. + * + * @return the runType value + */ + public RunType runType() { + return this.runType; + } + + /** + * Set the type of run. Possible values include: 'QuickBuild', 'QuickRun', 'AutoBuild', 'AutoRun'. + * + * @param runType the runType value to set + * @return the RunInner object itself. + */ + public RunInner withRunType(RunType runType) { + this.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. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the time the run was scheduled. + * + * @param createTime the createTime value to set + * @return the RunInner object itself. + */ + public RunInner withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the time the run started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the time the run started. + * + * @param startTime the startTime value to set + * @return the RunInner object itself. + */ + public RunInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the time the run finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the time the run finished. + * + * @param finishTime the finishTime value to set + * @return the RunInner object itself. + */ + public RunInner withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the list of all images that were generated from the run. This is applicable if the run generates base image dependencies. + * + * @return the outputImages value + */ + public List outputImages() { + return this.outputImages; + } + + /** + * Set the list of all images that were generated from the run. This is applicable if the run generates base image dependencies. + * + * @param outputImages the outputImages value to set + * @return the RunInner object itself. + */ + public RunInner withOutputImages(List outputImages) { + this.outputImages = outputImages; + return this; + } + + /** + * Get the task against which run was scheduled. + * + * @return the task value + */ + public String task() { + return this.task; + } + + /** + * Set the task against which run was scheduled. + * + * @param task the task value to set + * @return the RunInner object itself. + */ + public RunInner withTask(String task) { + this.task = task; + return this; + } + + /** + * Get the image update trigger that caused the run. This is applicable if the task has base image trigger configured. + * + * @return the imageUpdateTrigger value + */ + public ImageUpdateTrigger imageUpdateTrigger() { + return this.imageUpdateTrigger; + } + + /** + * Set the image update trigger that caused the run. This is applicable if the task has base image trigger configured. + * + * @param imageUpdateTrigger the imageUpdateTrigger value to set + * @return the RunInner object itself. + */ + public RunInner withImageUpdateTrigger(ImageUpdateTrigger imageUpdateTrigger) { + this.imageUpdateTrigger = imageUpdateTrigger; + return this; + } + + /** + * Get the source trigger that caused the run. + * + * @return the sourceTrigger value + */ + public SourceTriggerDescriptor sourceTrigger() { + return this.sourceTrigger; + } + + /** + * Set the source trigger that caused the run. + * + * @param sourceTrigger the sourceTrigger value to set + * @return the RunInner object itself. + */ + public RunInner withSourceTrigger(SourceTriggerDescriptor sourceTrigger) { + this.sourceTrigger = sourceTrigger; + return this; + } + + /** + * Get the timer trigger that caused the run. + * + * @return the timerTrigger value + */ + public TimerTriggerDescriptor timerTrigger() { + return this.timerTrigger; + } + + /** + * Set the timer trigger that caused the run. + * + * @param timerTrigger the timerTrigger value to set + * @return the RunInner object itself. + */ + public RunInner withTimerTrigger(TimerTriggerDescriptor timerTrigger) { + this.timerTrigger = timerTrigger; + return this; + } + + /** + * Get the platform properties against which the run will happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run will happen. + * + * @param platform the platform value to set + * @return the RunInner object itself. + */ + public RunInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the RunInner object itself. + */ + public RunInner withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = agentConfiguration; + return this; + } + + /** + * Get the scope of the credentials that were used to login to the source registry during this run. + * + * @return the sourceRegistryAuth value + */ + public String sourceRegistryAuth() { + return this.sourceRegistryAuth; + } + + /** + * Set the scope of the credentials that were used to login to the source registry during this run. + * + * @param sourceRegistryAuth the sourceRegistryAuth value to set + * @return the RunInner object itself. + */ + public RunInner withSourceRegistryAuth(String sourceRegistryAuth) { + this.sourceRegistryAuth = sourceRegistryAuth; + return this; + } + + /** + * Get the list of custom registries that were logged in during this run. + * + * @return the customRegistries value + */ + public List customRegistries() { + return this.customRegistries; + } + + /** + * Set the list of custom registries that were logged in during this run. + * + * @param customRegistries the customRegistries value to set + * @return the RunInner object itself. + */ + public RunInner withCustomRegistries(List customRegistries) { + this.customRegistries = customRegistries; + return this; + } + + /** + * Get the error message received from backend systems after the run is scheduled. + * + * @return the runErrorMessage value + */ + public String runErrorMessage() { + return this.runErrorMessage; + } + + /** + * Get the update trigger token passed for the Run. + * + * @return the updateTriggerToken value + */ + public String updateTriggerToken() { + return this.updateTriggerToken; + } + + /** + * Set the update trigger token passed for the Run. + * + * @param updateTriggerToken the updateTriggerToken value to set + * @return the RunInner object itself. + */ + public RunInner withUpdateTriggerToken(String updateTriggerToken) { + this.updateTriggerToken = updateTriggerToken; + return this; + } + + /** + * Get the provisioning state of a run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of a run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @param provisioningState the provisioningState value to set + * @return the RunInner object itself. + */ + public RunInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the RunInner object itself. + */ + public RunInner withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunsImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunsImpl.java new file mode 100644 index 000000000000..3362bd366d1c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunsImpl.java @@ -0,0 +1,89 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Runs; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunGetLogResult; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Run; + +class RunsImpl extends WrapperImpl implements Runs { + private final ContainerRegistryManager manager; + + RunsImpl(ContainerRegistryManager manager) { + super(manager.inner().runs()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + private RunImpl wrapModel(RunInner inner) { + return new RunImpl(inner, manager()); + } + + @Override + public Observable getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { + RunsInner client = this.inner(); + return client.getLogSasUrlAsync(resourceGroupName, registryName, runId) + .map(new Func1() { + @Override + public RunGetLogResult call(RunGetLogResultInner inner) { + return new RunGetLogResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable cancelAsync(String resourceGroupName, String registryName, String runId) { + RunsInner client = this.inner(); + return client.cancelAsync(resourceGroupName, registryName, runId).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + RunsInner 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 Run call(RunInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String runId) { + RunsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, runId) + .flatMap(new Func1>() { + @Override + public Observable call(RunInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Run)wrapModel(inner)); + } + } + }); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunsInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunsInner.java new file mode 100644 index 000000000000..48d894e7e02c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/RunsInner.java @@ -0,0 +1,1143 @@ +/** + * 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_12_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_12_01_preview.ErrorSchemaException; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunUpdateParameters; +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 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.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +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 Runs. + */ +public class RunsInner { + /** The Retrofit service to perform REST calls. */ + private RunsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RunsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RunsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RunsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Runs to be + * used by Retrofit to perform actually REST calls. + */ + interface RunsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Runs list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$top") Integer top, @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_12_01_preview.Runs get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @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_12_01_preview.Runs update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RunUpdateParameters runUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Runs beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RunUpdateParameters runUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Runs getLogSasUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl") + Observable> getLogSasUrl(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @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_12_01_preview.Runs cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel") + Observable> cancel(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @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_12_01_preview.Runs beginCancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel") + Observable> beginCancel(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("runId") String runId, @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_12_01_preview.Runs listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + 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(); + } + }; + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param 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); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunInner> 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(); + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RunInner> 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)); + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RunInner> 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."); + } + final String apiVersion = "2019-06-01-preview"; + final String filter = null; + final Integer top = null; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, filter, top, 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); + } + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param 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 ErrorSchemaException 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. + */ + public PagedList list(final String resourceGroupName, final String registryName, final String filter, final Integer top) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName, filter, top).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param 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. + * @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 String filter, final Integer top, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName, filter, top), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param 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 + * @return the observable to the PagedList<RunInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top) { + return listWithServiceResponseAsync(resourceGroupName, registryName, filter, top) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the runs for a registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param 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 + * @return the observable to the PagedList<RunInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top) { + return listSinglePageAsync(resourceGroupName, registryName, filter, top) + .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)); + } + }); + } + + /** + * Gets all the runs for a 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. + ServiceResponse> * @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. + ServiceResponse> * @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 + * @return the PagedList<RunInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top) { + 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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, filter, top, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorSchemaException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public RunInner get(String resourceGroupName, String registryName, String runId) { + return getWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body(); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @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 runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String runId) { + return getWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the detailed information for a given run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + 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 (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, runId, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public RunInner update(String resourceGroupName, String registryName, String runId) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().last().body(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param 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 runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String runId) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + 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 (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + final Boolean isArchiveEnabled = null; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + runUpdateParameters.withIsArchiveEnabled(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), runUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public RunInner update(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).toBlocking().last().body(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @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 runId, Boolean isArchiveEnabled, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled), serviceCallback); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + 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 (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + runUpdateParameters.withIsArchiveEnabled(isArchiveEnabled); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), runUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public RunInner beginUpdate(String resourceGroupName, String registryName, String runId) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param 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 runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String runId) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + 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 (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + final Boolean isArchiveEnabled = null; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + runUpdateParameters.withIsArchiveEnabled(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), runUpdateParameters, 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); + } + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public RunInner beginUpdate(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).toBlocking().single().body(); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @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 runId, Boolean isArchiveEnabled, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled), serviceCallback); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, runId, isArchiveEnabled).map(new Func1, RunInner>() { + @Override + public RunInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the run properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String runId, Boolean isArchiveEnabled) { + 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 (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + RunUpdateParameters runUpdateParameters = new RunUpdateParameters(); + runUpdateParameters.withIsArchiveEnabled(isArchiveEnabled); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), runUpdateParameters, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public RunGetLogResultInner getLogSasUrl(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body(); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @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 getLogSasUrlAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLogSasUrlWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunGetLogResultInner object + */ + public Observable getLogSasUrlAsync(String resourceGroupName, String registryName, String runId) { + return getLogSasUrlWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, RunGetLogResultInner>() { + @Override + public RunGetLogResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a link to download the run logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RunGetLogResultInner object + */ + public Observable> getLogSasUrlWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + 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 (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + return service.getLogSasUrl(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLogSasUrlDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLogSasUrlDelegate(Response response) throws ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void cancel(String resourceGroupName, String registryName, String runId) { + cancelWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().last().body(); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param 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 cancelAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable cancelAsync(String resourceGroupName, String registryName, String runId) { + return cancelWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> cancelWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + 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 (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.cancel(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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) { + beginCancelWithServiceResponseAsync(resourceGroupName, registryName, runId).toBlocking().single().body(); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @param 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 beginCancelAsync(String resourceGroupName, String registryName, String runId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCancelWithServiceResponseAsync(resourceGroupName, registryName, runId), serviceCallback); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCancelAsync(String resourceGroupName, String registryName, String runId) { + return beginCancelWithServiceResponseAsync(resourceGroupName, registryName, runId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel an existing run. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runId The run ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCancelWithServiceResponseAsync(String resourceGroupName, String registryName, String runId) { + 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 (runId == null) { + throw new IllegalArgumentException("Parameter runId is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + return service.beginCancel(this.client.subscriptionId(), resourceGroupName, registryName, runId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCancelDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCancelDelegate(Response response) throws ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Gets all the runs for a registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + 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(); + } + }; + } + + /** + * Gets all the runs for a 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); + } + + /** + * Gets all the runs for a 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<RunInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the runs for a 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<RunInner> 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)); + } + }); + } + + /** + * Gets all the runs for a 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<RunInner> 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorSchemaException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapImpl.java new file mode 100644 index 000000000000..c2a9b6ceafa3 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapImpl.java @@ -0,0 +1,164 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ScopeMap; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ScopeMapUpdateParameters; +import java.util.List; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import rx.functions.Func1; + +class ScopeMapImpl extends CreatableUpdatableImpl implements ScopeMap, ScopeMap.Definition, ScopeMap.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String scopeMapName; + private ScopeMapUpdateParameters updateParameter; + + ScopeMapImpl(String name, ContainerRegistryManager manager) { + super(name, new ScopeMapInner()); + this.manager = manager; + // Set resource name + this.scopeMapName = name; + // + this.updateParameter = new ScopeMapUpdateParameters(); + } + + ScopeMapImpl(ScopeMapInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.scopeMapName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.scopeMapName = IdParsingUtils.getValueFromIdByName(inner.id(), "scopeMaps"); + // + this.updateParameter = new ScopeMapUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ScopeMapsInner client = this.manager().inner().scopeMaps(); + return client.createAsync(this.resourceGroupName, this.registryName, this.scopeMapName, this.inner()) + .map(new Func1() { + @Override + public ScopeMapInner call(ScopeMapInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ScopeMapsInner client = this.manager().inner().scopeMaps(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.scopeMapName, this.updateParameter) + .map(new Func1() { + @Override + public ScopeMapInner call(ScopeMapInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ScopeMapsInner client = this.manager().inner().scopeMaps(); + return client.getAsync(this.resourceGroupName, this.registryName, this.scopeMapName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new ScopeMapUpdateParameters(); + } + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String description() { + return this.inner().description(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scopeMapType() { + return this.inner().scopeMapType(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ScopeMapImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public ScopeMapImpl withActions(List actions) { + if (isInCreateMode()) { + this.inner().withActions(actions); + } else { + this.updateParameter.withActions(actions); + } + return this; + } + + @Override + public ScopeMapImpl withDescription(String description) { + if (isInCreateMode()) { + this.inner().withDescription(description); + } else { + this.updateParameter.withDescription(description); + } + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapInner.java new file mode 100644 index 000000000000..cb03e6b97152 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapInner.java @@ -0,0 +1,127 @@ +/** + * 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_12_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An object that represents a scope map for a container registry. + */ +@JsonFlatten +public class ScopeMapInner extends ProxyResource { + /** + * The user friendly description of the scope map. + */ + @JsonProperty(value = "properties.description") + private String description; + + /** + * The type of the scope map. E.g. BuildIn scope map. + */ + @JsonProperty(value = "properties.type", access = JsonProperty.Access.WRITE_ONLY) + private String scopeMapType; + + /** + * The creation date of scope map. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * Provisioning state of the resource. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The list of scoped permissions for registry artifacts. + * E.g. repositories/repository-name/content/read, + * repositories/repository-name/metadata/write. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * Get the user friendly description of the scope map. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the user friendly description of the scope map. + * + * @param description the description value to set + * @return the ScopeMapInner object itself. + */ + public ScopeMapInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the type of the scope map. E.g. BuildIn scope map. + * + * @return the scopeMapType value + */ + public String scopeMapType() { + return this.scopeMapType; + } + + /** + * Get the creation date of scope map. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get provisioning state of the resource. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the list of scoped permissions for registry artifacts. + E.g. repositories/repository-name/content/read, + repositories/repository-name/metadata/write. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of scoped permissions for registry artifacts. + E.g. repositories/repository-name/content/read, + repositories/repository-name/metadata/write. + * + * @param actions the actions value to set + * @return the ScopeMapInner object itself. + */ + public ScopeMapInner withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapsImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapsImpl.java new file mode 100644 index 000000000000..576d77eb9cb5 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapsImpl.java @@ -0,0 +1,85 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ScopeMaps; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ScopeMap; + +class ScopeMapsImpl extends WrapperImpl implements ScopeMaps { + private final ContainerRegistryManager manager; + + ScopeMapsImpl(ContainerRegistryManager manager) { + super(manager.inner().scopeMaps()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public ScopeMapImpl define(String name) { + return wrapModel(name); + } + + private ScopeMapImpl wrapModel(ScopeMapInner inner) { + return new ScopeMapImpl(inner, manager()); + } + + private ScopeMapImpl wrapModel(String name) { + return new ScopeMapImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + ScopeMapsInner 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 ScopeMap call(ScopeMapInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String scopeMapName) { + ScopeMapsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, scopeMapName) + .flatMap(new Func1>() { + @Override + public Observable call(ScopeMapInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((ScopeMap)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String scopeMapName) { + ScopeMapsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, scopeMapName).toCompletable(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapsInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapsInner.java new file mode 100644 index 000000000000..8e4ec4b9c66f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/ScopeMapsInner.java @@ -0,0 +1,956 @@ +/** + * 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_12_01_preview.implementation; + +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_12_01_preview.ScopeMapUpdateParameters; +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.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 ScopeMaps. + */ +public class ScopeMapsInner { + /** The Retrofit service to perform REST calls. */ + private ScopeMapsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ScopeMapsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ScopeMapsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(ScopeMapsService.class); + this.client = client; + } + + /** + * The interface defining all the services for ScopeMaps to be + * used by Retrofit to perform actually REST calls. + */ + interface ScopeMapsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ScopeMaps get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("scopeMapName") String scopeMapName, @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_12_01_preview.ScopeMaps create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("scopeMapName") String scopeMapName, @Query("api-version") String apiVersion, @Body ScopeMapInner scopeMapCreateParameters, @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_12_01_preview.ScopeMaps beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("scopeMapName") String scopeMapName, @Query("api-version") String apiVersion, @Body ScopeMapInner scopeMapCreateParameters, @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_12_01_preview.ScopeMaps delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("scopeMapName") String scopeMapName, @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_12_01_preview.ScopeMaps beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("scopeMapName") String scopeMapName, @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_12_01_preview.ScopeMaps update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("scopeMapName") String scopeMapName, @Query("api-version") String apiVersion, @Body ScopeMapUpdateParameters scopeMapUpdateParameters, @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_12_01_preview.ScopeMaps beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps/{scopeMapName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("scopeMapName") String scopeMapName, @Query("api-version") String apiVersion, @Body ScopeMapUpdateParameters scopeMapUpdateParameters, @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_12_01_preview.ScopeMaps list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scopeMaps") + 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_12_01_preview.ScopeMaps listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ScopeMapInner object if successful. + */ + public ScopeMapInner get(String resourceGroupName, String registryName, String scopeMapName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @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 scopeMapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName), serviceCallback); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ScopeMapInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String scopeMapName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName).map(new Func1, ScopeMapInner>() { + @Override + public ScopeMapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified scope map. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ScopeMapInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String scopeMapName) { + 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 (scopeMapName == null) { + throw new IllegalArgumentException("Parameter scopeMapName is required and cannot be null."); + } + final String apiVersion = "2019-05-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, scopeMapName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ScopeMapInner object if successful. + */ + public ScopeMapInner create(String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @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 scopeMapName, ScopeMapInner scopeMapCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters), serviceCallback); + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters).map(new Func1, ScopeMapInner>() { + @Override + public ScopeMapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + 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 (scopeMapName == null) { + throw new IllegalArgumentException("Parameter scopeMapName is required and cannot be null."); + } + if (scopeMapCreateParameters == null) { + throw new IllegalArgumentException("Parameter scopeMapCreateParameters is required and cannot be null."); + } + Validator.validate(scopeMapCreateParameters); + final String apiVersion = "2019-05-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, scopeMapName, apiVersion, scopeMapCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ScopeMapInner object if successful. + */ + public ScopeMapInner beginCreate(String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @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 scopeMapName, ScopeMapInner scopeMapCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters), serviceCallback); + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ScopeMapInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters).map(new Func1, ScopeMapInner>() { + @Override + public ScopeMapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapCreateParameters The parameters for creating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ScopeMapInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String scopeMapName, ScopeMapInner scopeMapCreateParameters) { + 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 (scopeMapName == null) { + throw new IllegalArgumentException("Parameter scopeMapName is required and cannot be null."); + } + if (scopeMapCreateParameters == null) { + throw new IllegalArgumentException("Parameter scopeMapCreateParameters is required and cannot be null."); + } + Validator.validate(scopeMapCreateParameters); + final String apiVersion = "2019-05-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, scopeMapName, apiVersion, scopeMapCreateParameters, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 scopeMapName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName).toBlocking().last().body(); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @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 scopeMapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName), serviceCallback); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String scopeMapName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String scopeMapName) { + 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 (scopeMapName == null) { + throw new IllegalArgumentException("Parameter scopeMapName is required and cannot be null."); + } + final String apiVersion = "2019-05-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, scopeMapName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 scopeMapName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName).toBlocking().single().body(); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @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 scopeMapName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName), serviceCallback); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String scopeMapName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a scope map from a 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 scopeMapName The name of the scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String scopeMapName) { + 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 (scopeMapName == null) { + throw new IllegalArgumentException("Parameter scopeMapName is required and cannot be null."); + } + final String apiVersion = "2019-05-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, scopeMapName, 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 CloudException, 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) + .build(response); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ScopeMapInner object if successful. + */ + public ScopeMapInner update(String resourceGroupName, String registryName, String scopeMapName, ScopeMapUpdateParameters scopeMapUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @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 scopeMapName, ScopeMapUpdateParameters scopeMapUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters), serviceCallback); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String scopeMapName, ScopeMapUpdateParameters scopeMapUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters).map(new Func1, ScopeMapInner>() { + @Override + public ScopeMapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String scopeMapName, ScopeMapUpdateParameters scopeMapUpdateParameters) { + 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 (scopeMapName == null) { + throw new IllegalArgumentException("Parameter scopeMapName is required and cannot be null."); + } + if (scopeMapUpdateParameters == null) { + throw new IllegalArgumentException("Parameter scopeMapUpdateParameters is required and cannot be null."); + } + Validator.validate(scopeMapUpdateParameters); + final String apiVersion = "2019-05-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, scopeMapName, apiVersion, scopeMapUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ScopeMapInner object if successful. + */ + public ScopeMapInner beginUpdate(String resourceGroupName, String registryName, String scopeMapName, ScopeMapUpdateParameters scopeMapUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @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 scopeMapName, ScopeMapUpdateParameters scopeMapUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters), serviceCallback); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ScopeMapInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String scopeMapName, ScopeMapUpdateParameters scopeMapUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters).map(new Func1, ScopeMapInner>() { + @Override + public ScopeMapInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a scope map 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 scopeMapName The name of the scope map. + * @param scopeMapUpdateParameters The parameters for updating a scope map. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ScopeMapInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String scopeMapName, ScopeMapUpdateParameters scopeMapUpdateParameters) { + 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 (scopeMapName == null) { + throw new IllegalArgumentException("Parameter scopeMapName is required and cannot be null."); + } + if (scopeMapUpdateParameters == null) { + throw new IllegalArgumentException("Parameter scopeMapUpdateParameters is required and cannot be null."); + } + Validator.validate(scopeMapUpdateParameters); + final String apiVersion = "2019-05-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, scopeMapName, apiVersion, scopeMapUpdateParameters, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the scope maps for the 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 CloudException 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<ScopeMapInner> 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 scope maps for the 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 scope maps for the 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<ScopeMapInner> 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 scope maps for the 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<ScopeMapInner> 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 scope maps for the 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<ScopeMapInner> 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."); + } + final String apiVersion = "2019-05-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the scope maps for the specified container registry. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ScopeMapInner> 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 scope maps for the 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 scope maps for the 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<ScopeMapInner> 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 scope maps for the 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<ScopeMapInner> 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 scope maps for the 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<ScopeMapInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/SourceUploadDefinitionImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/SourceUploadDefinitionImpl.java new file mode 100644 index 000000000000..def4f6fde964 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/SourceUploadDefinitionImpl.java @@ -0,0 +1,36 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.SourceUploadDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class SourceUploadDefinitionImpl extends WrapperImpl implements SourceUploadDefinition { + private final ContainerRegistryManager manager; + SourceUploadDefinitionImpl(SourceUploadDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String relativePath() { + return this.inner().relativePath(); + } + + @Override + public String uploadUrl() { + return this.inner().uploadUrl(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/SourceUploadDefinitionInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/SourceUploadDefinitionInner.java new file mode 100644 index 000000000000..18c847a463e0 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/SourceUploadDefinitionInner.java @@ -0,0 +1,70 @@ +/** + * 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_12_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a response to source upload request. + */ +public class SourceUploadDefinitionInner { + /** + * The URL where the client can upload the source. + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /** + * The relative path to the source. This is used to submit the subsequent + * queue build request. + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** + * Get the URL where the client can upload the source. + * + * @return the uploadUrl value + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set the URL where the client can upload the source. + * + * @param uploadUrl the uploadUrl value to set + * @return the SourceUploadDefinitionInner object itself. + */ + public SourceUploadDefinitionInner withUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + * Get the relative path to the source. This is used to submit the subsequent queue build request. + * + * @return the relativePath value + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relative path to the source. This is used to submit the subsequent queue build request. + * + * @param relativePath the relativePath value to set + * @return the SourceUploadDefinitionInner object itself. + */ + public SourceUploadDefinitionInner withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskImpl.java new file mode 100644 index 000000000000..f8a6ab1c6065 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskImpl.java @@ -0,0 +1,306 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Task; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.IdentityProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskStatus; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.AgentProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskStepProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TriggerProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Credentials; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PlatformUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskStepUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TriggerUpdateParameters; +import rx.functions.Func1; + +class TaskImpl extends CreatableUpdatableImpl implements Task, Task.Definition, Task.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String taskName; + private TaskUpdateParameters updateParameter; + + TaskImpl(String name, ContainerRegistryManager manager) { + super(name, new TaskInner()); + this.manager = manager; + // Set resource name + this.taskName = name; + // + this.updateParameter = new TaskUpdateParameters(); + } + + TaskImpl(TaskInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.taskName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.taskName = IdParsingUtils.getValueFromIdByName(inner.id(), "tasks"); + // + this.updateParameter = new TaskUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.createAsync(this.resourceGroupName, this.registryName, this.taskName, this.inner()) + .map(new Func1() { + @Override + public TaskInner call(TaskInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.taskName, this.updateParameter) + .map(new Func1() { + @Override + public TaskInner call(TaskInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TasksInner client = this.manager().inner().tasks(); + return client.getAsync(this.resourceGroupName, this.registryName, this.taskName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new TaskUpdateParameters(); + } + + @Override + public AgentProperties agentConfiguration() { + return this.inner().agentConfiguration(); + } + + @Override + public String agentPoolName() { + return this.inner().agentPoolName(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public Credentials credentials() { + return this.inner().credentials(); + } + + @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 PlatformProperties platform() { + return this.inner().platform(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public TaskStatus status() { + return this.inner().status(); + } + + @Override + public TaskStepProperties step() { + return this.inner().step(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public Integer timeout() { + return this.inner().timeout(); + } + + @Override + public TriggerProperties trigger() { + return this.inner().trigger(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TaskImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public TaskImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public TaskImpl withPlatform(PlatformProperties platform) { + this.inner().withPlatform(platform); + return this; + } + + @Override + public TaskImpl withStep(TaskStepProperties step) { + this.inner().withStep(step); + return this; + } + + @Override + public TaskImpl withTrigger(TriggerProperties trigger) { + this.inner().withTrigger(trigger); + return this; + } + + @Override + public TaskImpl withPlatform(PlatformUpdateParameters platform) { + this.updateParameter.withPlatform(platform); + return this; + } + + @Override + public TaskImpl withStep(TaskStepUpdateParameters step) { + this.updateParameter.withStep(step); + return this; + } + + @Override + public TaskImpl withTrigger(TriggerUpdateParameters trigger) { + this.updateParameter.withTrigger(trigger); + return this; + } + + @Override + public TaskImpl withAgentConfiguration(AgentProperties agentConfiguration) { + if (isInCreateMode()) { + this.inner().withAgentConfiguration(agentConfiguration); + } else { + this.updateParameter.withAgentConfiguration(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()) { + this.inner().withCredentials(credentials); + } else { + this.updateParameter.withCredentials(credentials); + } + return this; + } + + @Override + public TaskImpl withIdentity(IdentityProperties identity) { + if (isInCreateMode()) { + this.inner().withIdentity(identity); + } else { + this.updateParameter.withIdentity(identity); + } + return this; + } + + @Override + public TaskImpl withStatus(TaskStatus status) { + if (isInCreateMode()) { + this.inner().withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + + @Override + public TaskImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public TaskImpl withTimeout(Integer timeout) { + if (isInCreateMode()) { + this.inner().withTimeout(timeout); + } else { + this.updateParameter.withTimeout(timeout); + } + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskInner.java new file mode 100644 index 000000000000..6fde0b644086 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskInner.java @@ -0,0 +1,297 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.IdentityProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskStatus; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.AgentProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskStepProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TriggerProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Credentials; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The task that has the ARM resource and task properties. + * The task will have all information to schedule a run against it. + */ +@JsonFlatten +public class TaskInner extends Resource { + /** + * Identity for the resource. + */ + @JsonProperty(value = "identity") + private IdentityProperties identity; + + /** + * The provisioning state of the task. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The creation date of task. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The current status of task. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "properties.status") + private TaskStatus status; + + /** + * The platform properties against which the run has to happen. + */ + @JsonProperty(value = "properties.platform", required = true) + private PlatformProperties platform; + + /** + * The machine configuration of the run agent. + */ + @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. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The properties of a task step. + */ + @JsonProperty(value = "properties.step", required = true) + private TaskStepProperties step; + + /** + * The properties that describe all triggers for the task. + */ + @JsonProperty(value = "properties.trigger") + private TriggerProperties trigger; + + /** + * The properties that describes a set of credentials that will be used + * when this run is invoked. + */ + @JsonProperty(value = "properties.credentials") + private Credentials credentials; + + /** + * 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 TaskInner object itself. + */ + public TaskInner withIdentity(IdentityProperties identity) { + this.identity = identity; + return this; + } + + /** + * Get the provisioning state of the task. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the creation date of task. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the current status of task. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public TaskStatus status() { + return this.status; + } + + /** + * Set the current status of task. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the TaskInner object itself. + */ + public TaskInner withStatus(TaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the platform properties against which the run has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the run has to happen. + * + * @param platform the platform value to set + * @return the TaskInner object itself. + */ + public TaskInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the machine configuration of the run agent. + * + * @return the agentConfiguration value + */ + public AgentProperties agentConfiguration() { + return this.agentConfiguration; + } + + /** + * Set the machine configuration of the run agent. + * + * @param agentConfiguration the agentConfiguration value to set + * @return the TaskInner object itself. + */ + public TaskInner withAgentConfiguration(AgentProperties agentConfiguration) { + this.agentConfiguration = 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. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set run timeout in seconds. + * + * @param timeout the timeout value to set + * @return the TaskInner object itself. + */ + public TaskInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the properties of a task step. + * + * @return the step value + */ + public TaskStepProperties step() { + return this.step; + } + + /** + * Set the properties of a task step. + * + * @param step the step value to set + * @return the TaskInner object itself. + */ + public TaskInner withStep(TaskStepProperties step) { + this.step = step; + return this; + } + + /** + * Get the properties that describe all triggers for the task. + * + * @return the trigger value + */ + public TriggerProperties trigger() { + return this.trigger; + } + + /** + * Set the properties that describe all triggers for the task. + * + * @param trigger the trigger value to set + * @return the TaskInner object itself. + */ + public TaskInner withTrigger(TriggerProperties trigger) { + this.trigger = trigger; + return this; + } + + /** + * Get the properties that describes a set of credentials that will be used when this run is invoked. + * + * @return the credentials value + */ + public Credentials credentials() { + return this.credentials; + } + + /** + * Set the properties that describes a set of credentials that will be used when this run is invoked. + * + * @param credentials the credentials value to set + * @return the TaskInner object itself. + */ + public TaskInner withCredentials(Credentials credentials) { + this.credentials = credentials; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunImpl.java new file mode 100644 index 000000000000..fb0830618133 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunImpl.java @@ -0,0 +1,207 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskRun; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskRunUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.IdentityProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunRequest; +import com.microsoft.azure.management.containerregistry.v2019_12_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 Map tags() { + return this.inner().getTags(); + } + + @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 withLocation(String location) { + this.inner().withLocation(location); + 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 withRunRequest(RunRequest runRequest) { + if (isInCreateMode()) { + this.inner().withRunRequest(runRequest); + } else { + this.updateParameter.withRunRequest(runRequest); + } + return this; + } + + @Override + public TaskRunImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunInner.java new file mode 100644 index 000000000000..872da3aad351 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunInner.java @@ -0,0 +1,134 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.IdentityProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.RunRequest; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * 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 Resource { + /** + * 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; + + /** + * 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; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunsImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunsImpl.java new file mode 100644 index 000000000000..06011b76b7b7 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunsInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunsInner.java new file mode 100644 index 000000000000..fc0d9b4e33af --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TaskRunsInner.java @@ -0,0 +1,1052 @@ +/** + * 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_12_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_12_01_preview.ErrorSchemaException; +import com.microsoft.azure.management.containerregistry.v2019_12_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_12_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_12_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_12_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_12_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_12_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_12_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_12_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_12_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_12_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_12_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 run request name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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 run request name. + * @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 run request name. + * @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 run request name. + * @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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.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 task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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 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 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 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 (taskRun == null) { + throw new IllegalArgumentException("Parameter taskRun is required and cannot be null."); + } + Validator.validate(taskRun); + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, 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 task run. + * @param taskRun The parameters of a run that needs to scheduled. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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 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 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 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 (taskRun == null) { + throw new IllegalArgumentException("Parameter taskRun is required and cannot be null."); + } + Validator.validate(taskRun); + final String apiVersion = "2019-06-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.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 task run name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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 task run name. + * @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 task run name. + * @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 task run name. + * @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."); + } + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, 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 task run name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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 task run name. + * @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 task run name. + * @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 task run name. + * @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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, 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 ErrorSchemaException, 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(ErrorSchemaException.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 task run name. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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 task run name. + * @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 task run name. + * @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 task run name. + * @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 (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, 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 task run name. + * @param updateParameters The parameters for updating a task run. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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 task run name. + * @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 task run name. + * @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 task run name. + * @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 (updateParameters == null) { + throw new IllegalArgumentException("Parameter updateParameters is required and cannot be null."); + } + Validator.validate(updateParameters); + final String apiVersion = "2019-06-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.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 run request name. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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 run request name. + * @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 run request name. + * @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 run request name. + * @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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.getDetails(this.client.subscriptionId(), resourceGroupName, registryName, taskRunName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.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 ErrorSchemaException 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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorSchemaException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorSchemaException.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 ErrorSchemaException 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorSchemaException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TasksImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TasksImpl.java new file mode 100644 index 000000000000..2400557d20da --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TasksImpl.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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Tasks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Task; + +class TasksImpl extends WrapperImpl implements Tasks { + private final ContainerRegistryManager manager; + + TasksImpl(ContainerRegistryManager manager) { + super(manager.inner().tasks()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public TaskImpl define(String name) { + return wrapModel(name); + } + + private TaskImpl wrapModel(TaskInner inner) { + return new TaskImpl(inner, manager()); + } + + private TaskImpl wrapModel(String name) { + return new TaskImpl(name, this.manager()); + } + + @Override + public Observable getDetailsAsync(String resourceGroupName, String registryName, String taskName) { + TasksInner client = this.inner(); + return client.getDetailsAsync(resourceGroupName, registryName, taskName) + .map(new Func1() { + @Override + public Task call(TaskInner inner) { + return new TaskImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + TasksInner 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 Task call(TaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String taskName) { + TasksInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, taskName) + .flatMap(new Func1>() { + @Override + public Observable call(TaskInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Task)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String taskName) { + TasksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, taskName).toCompletable(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TasksInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TasksInner.java new file mode 100644 index 000000000000..04e23c38848f --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TasksInner.java @@ -0,0 +1,1052 @@ +/** + * 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_12_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_12_01_preview.ErrorSchemaException; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TaskUpdateParameters; +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 Tasks. + */ +public class TasksInner { + /** The Retrofit service to perform REST calls. */ + private TasksService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of TasksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TasksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(TasksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tasks to be + * used by Retrofit to perform actually REST calls. + */ + interface TasksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Tasks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks") + 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_12_01_preview.Tasks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @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_12_01_preview.Tasks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body TaskInner taskCreateParameters, @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_12_01_preview.Tasks beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body TaskInner taskCreateParameters, @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_12_01_preview.Tasks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @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_12_01_preview.Tasks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @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_12_01_preview.Tasks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body TaskUpdateParameters taskUpdateParameters, @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_12_01_preview.Tasks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @Query("api-version") String apiVersion, @Body TaskUpdateParameters taskUpdateParameters, @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_12_01_preview.Tasks getDetails" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails") + Observable> getDetails(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("taskName") String taskName, @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_12_01_preview.Tasks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + 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 tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param 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 tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TaskInner> 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 tasks for a specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<TaskInner> 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 tasks 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<TaskInner> 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."); + } + final String apiVersion = "2019-06-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorSchemaException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public TaskInner get(String resourceGroupName, String registryName, String taskName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().single().body(); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @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 taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, taskName), serviceCallback); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String taskName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName) { + 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 (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, taskName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public TaskInner create(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param 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 taskName, TaskInner taskCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters), serviceCallback); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + 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 (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (taskCreateParameters == null) { + throw new IllegalArgumentException("Parameter taskCreateParameters is required and cannot be null."); + } + Validator.validate(taskCreateParameters); + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, taskCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public TaskInner beginCreate(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @param 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 taskName, TaskInner taskCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters), serviceCallback); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskCreateParameters).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a task for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskCreateParameters The parameters for creating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName, TaskInner taskCreateParameters) { + 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 (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (taskCreateParameters == null) { + throw new IllegalArgumentException("Parameter taskCreateParameters is required and cannot be null."); + } + Validator.validate(taskCreateParameters); + final String apiVersion = "2019-06-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, taskCreateParameters, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().last().body(); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param 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 taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, taskName), serviceCallback); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String taskName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName) { + 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 (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().single().body(); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param 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 taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskName), serviceCallback); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String taskName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName) { + 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 (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, taskName, 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 ErrorSchemaException, 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(ErrorSchemaException.class) + .build(response); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public TaskInner update(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param 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 taskName, TaskUpdateParameters taskUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters), serviceCallback); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + 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 (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (taskUpdateParameters == null) { + throw new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null."); + } + Validator.validate(taskUpdateParameters); + final String apiVersion = "2019-06-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, taskUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public TaskInner beginUpdate(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @param 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 taskName, TaskUpdateParameters taskUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters), serviceCallback); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, taskName, taskUpdateParameters).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a task with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @param taskUpdateParameters The parameters for updating a task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName, TaskUpdateParameters taskUpdateParameters) { + 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 (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + if (taskUpdateParameters == null) { + throw new IllegalArgumentException("Parameter taskUpdateParameters is required and cannot be null."); + } + Validator.validate(taskUpdateParameters); + final String apiVersion = "2019-06-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, taskName, apiVersion, taskUpdateParameters, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorSchemaException 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. + */ + public TaskInner getDetails(String resourceGroupName, String registryName, String taskName) { + return getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskName).toBlocking().single().body(); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @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 taskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskName), serviceCallback); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable getDetailsAsync(String resourceGroupName, String registryName, String taskName) { + return getDetailsWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1, TaskInner>() { + @Override + public TaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Returns a task with extended information that includes all secrets. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param taskName The name of the container registry task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TaskInner object + */ + public Observable> getDetailsWithServiceResponseAsync(String resourceGroupName, String registryName, String taskName) { + 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 (taskName == null) { + throw new IllegalArgumentException("Parameter taskName is required and cannot be null."); + } + final String apiVersion = "2019-06-01-preview"; + return service.getDetails(this.client.subscriptionId(), resourceGroupName, registryName, taskName, 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + + /** + * Lists all the tasks 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 ErrorSchemaException 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. + */ + 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 tasks 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 tasks 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<TaskInner> 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 tasks 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<TaskInner> 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 tasks 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<TaskInner> 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 ErrorSchemaException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorSchemaException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorSchemaException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokenImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokenImpl.java new file mode 100644 index 000000000000..af49ae44271e --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokenImpl.java @@ -0,0 +1,175 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Token; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TokenUpdateParameters; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TokenCredentialsProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TokenStatus; +import rx.functions.Func1; + +class TokenImpl extends CreatableUpdatableImpl implements Token, Token.Definition, Token.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String tokenName; + private TokenUpdateParameters updateParameter; + + TokenImpl(String name, ContainerRegistryManager manager) { + super(name, new TokenInner()); + this.manager = manager; + // Set resource name + this.tokenName = name; + // + this.updateParameter = new TokenUpdateParameters(); + } + + TokenImpl(TokenInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.tokenName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.tokenName = IdParsingUtils.getValueFromIdByName(inner.id(), "tokens"); + // + this.updateParameter = new TokenUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + TokensInner client = this.manager().inner().tokens(); + return client.createAsync(this.resourceGroupName, this.registryName, this.tokenName, this.inner()) + .map(new Func1() { + @Override + public TokenInner call(TokenInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + TokensInner client = this.manager().inner().tokens(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.tokenName, this.updateParameter) + .map(new Func1() { + @Override + public TokenInner call(TokenInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + TokensInner client = this.manager().inner().tokens(); + return client.getAsync(this.resourceGroupName, this.registryName, this.tokenName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new TokenUpdateParameters(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public TokenCredentialsProperties credentials() { + return this.inner().credentials(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scopeMapId() { + return this.inner().scopeMapId(); + } + + @Override + public TokenStatus status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public TokenImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public TokenImpl withCredentials(TokenCredentialsProperties credentials) { + if (isInCreateMode()) { + this.inner().withCredentials(credentials); + } else { + this.updateParameter.withCredentials(credentials); + } + return this; + } + + @Override + public TokenImpl withScopeMapId(String scopeMapId) { + if (isInCreateMode()) { + this.inner().withScopeMapId(scopeMapId); + } else { + this.updateParameter.withScopeMapId(scopeMapId); + } + return this; + } + + @Override + public TokenImpl withStatus(TokenStatus status) { + if (isInCreateMode()) { + this.inner().withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokenInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokenInner.java new file mode 100644 index 000000000000..5d460e492d49 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokenInner.java @@ -0,0 +1,135 @@ +/** + * 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_12_01_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TokenCredentialsProperties; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.TokenStatus; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.ProxyResource; + +/** + * An object that represents a token for a container registry. + */ +@JsonFlatten +public class TokenInner extends ProxyResource { + /** + * The creation date of scope map. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * Provisioning state of the resource. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The resource ID of the scope map to which the token will be associated + * with. + */ + @JsonProperty(value = "properties.scopeMapId") + private String scopeMapId; + + /** + * The credentials that can be used for authenticating the token. + */ + @JsonProperty(value = "properties.credentials") + private TokenCredentialsProperties credentials; + + /** + * The status of the token example enabled or disabled. Possible values + * include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private TokenStatus status; + + /** + * Get the creation date of scope map. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get provisioning state of the resource. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the resource ID of the scope map to which the token will be associated with. + * + * @return the scopeMapId value + */ + public String scopeMapId() { + return this.scopeMapId; + } + + /** + * Set the resource ID of the scope map to which the token will be associated with. + * + * @param scopeMapId the scopeMapId value to set + * @return the TokenInner object itself. + */ + public TokenInner withScopeMapId(String scopeMapId) { + this.scopeMapId = scopeMapId; + return this; + } + + /** + * Get the credentials that can be used for authenticating the token. + * + * @return the credentials value + */ + public TokenCredentialsProperties credentials() { + return this.credentials; + } + + /** + * Set the credentials that can be used for authenticating the token. + * + * @param credentials the credentials value to set + * @return the TokenInner object itself. + */ + public TokenInner withCredentials(TokenCredentialsProperties credentials) { + this.credentials = credentials; + return this; + } + + /** + * Get the status of the token example enabled or disabled. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public TokenStatus status() { + return this.status; + } + + /** + * Set the status of the token example enabled or disabled. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the TokenInner object itself. + */ + public TokenInner withStatus(TokenStatus status) { + this.status = status; + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokensImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokensImpl.java new file mode 100644 index 000000000000..15e3ac3a0415 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokensImpl.java @@ -0,0 +1,85 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Tokens; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Token; + +class TokensImpl extends WrapperImpl implements Tokens { + private final ContainerRegistryManager manager; + + TokensImpl(ContainerRegistryManager manager) { + super(manager.inner().tokens()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public TokenImpl define(String name) { + return wrapModel(name); + } + + private TokenImpl wrapModel(TokenInner inner) { + return new TokenImpl(inner, manager()); + } + + private TokenImpl wrapModel(String name) { + return new TokenImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + TokensInner 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 Token call(TokenInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String tokenName) { + TokensInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, tokenName) + .flatMap(new Func1>() { + @Override + public Observable call(TokenInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Token)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String tokenName) { + TokensInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, tokenName).toCompletable(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokensInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokensInner.java new file mode 100644 index 000000000000..13708d17e8f2 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/TokensInner.java @@ -0,0 +1,956 @@ +/** + * 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_12_01_preview.implementation; + +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_12_01_preview.TokenUpdateParameters; +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.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 Tokens. + */ +public class TokensInner { + /** The Retrofit service to perform REST calls. */ + private TokensService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of TokensInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public TokensInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(TokensService.class); + this.client = client; + } + + /** + * The interface defining all the services for Tokens to be + * used by Retrofit to perform actually REST calls. + */ + interface TokensService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Tokens get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("tokenName") String tokenName, @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_12_01_preview.Tokens create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("tokenName") String tokenName, @Query("api-version") String apiVersion, @Body TokenInner tokenCreateParameters, @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_12_01_preview.Tokens beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("tokenName") String tokenName, @Query("api-version") String apiVersion, @Body TokenInner tokenCreateParameters, @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_12_01_preview.Tokens delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("tokenName") String tokenName, @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_12_01_preview.Tokens beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("tokenName") String tokenName, @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_12_01_preview.Tokens update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("tokenName") String tokenName, @Query("api-version") String apiVersion, @Body TokenUpdateParameters tokenUpdateParameters, @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_12_01_preview.Tokens beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens/{tokenName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("tokenName") String tokenName, @Query("api-version") String apiVersion, @Body TokenUpdateParameters tokenUpdateParameters, @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_12_01_preview.Tokens list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tokens") + 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_12_01_preview.Tokens listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TokenInner object if successful. + */ + public TokenInner get(String resourceGroupName, String registryName, String tokenName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, tokenName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @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 tokenName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, tokenName), serviceCallback); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TokenInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String tokenName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, tokenName).map(new Func1, TokenInner>() { + @Override + public TokenInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified token. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TokenInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String tokenName) { + 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 (tokenName == null) { + throw new IllegalArgumentException("Parameter tokenName is required and cannot be null."); + } + final String apiVersion = "2019-05-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, tokenName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TokenInner object if successful. + */ + public TokenInner create(String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @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 tokenName, TokenInner tokenCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters), serviceCallback); + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).map(new Func1, TokenInner>() { + @Override + public TokenInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + 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 (tokenName == null) { + throw new IllegalArgumentException("Parameter tokenName is required and cannot be null."); + } + if (tokenCreateParameters == null) { + throw new IllegalArgumentException("Parameter tokenCreateParameters is required and cannot be null."); + } + Validator.validate(tokenCreateParameters); + final String apiVersion = "2019-05-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, tokenName, apiVersion, tokenCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TokenInner object if successful. + */ + public TokenInner beginCreate(String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @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 tokenName, TokenInner tokenCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters), serviceCallback); + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TokenInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenCreateParameters).map(new Func1, TokenInner>() { + @Override + public TokenInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a token 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 tokenName The name of the token. + * @param tokenCreateParameters The parameters for creating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TokenInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String tokenName, TokenInner tokenCreateParameters) { + 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 (tokenName == null) { + throw new IllegalArgumentException("Parameter tokenName is required and cannot be null."); + } + if (tokenCreateParameters == null) { + throw new IllegalArgumentException("Parameter tokenCreateParameters is required and cannot be null."); + } + Validator.validate(tokenCreateParameters); + final String apiVersion = "2019-05-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, tokenName, apiVersion, tokenCreateParameters, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 tokenName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, tokenName).toBlocking().last().body(); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @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 tokenName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, tokenName), serviceCallback); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String tokenName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, tokenName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String tokenName) { + 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 (tokenName == null) { + throw new IllegalArgumentException("Parameter tokenName is required and cannot be null."); + } + final String apiVersion = "2019-05-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, tokenName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 tokenName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, tokenName).toBlocking().single().body(); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @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 tokenName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, tokenName), serviceCallback); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String tokenName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, tokenName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a token from a 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 tokenName The name of the token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String tokenName) { + 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 (tokenName == null) { + throw new IllegalArgumentException("Parameter tokenName is required and cannot be null."); + } + final String apiVersion = "2019-05-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, tokenName, 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 CloudException, 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) + .build(response); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TokenInner object if successful. + */ + public TokenInner update(String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @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 tokenName, TokenUpdateParameters tokenUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters), serviceCallback); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).map(new Func1, TokenInner>() { + @Override + public TokenInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + 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 (tokenName == null) { + throw new IllegalArgumentException("Parameter tokenName is required and cannot be null."); + } + if (tokenUpdateParameters == null) { + throw new IllegalArgumentException("Parameter tokenUpdateParameters is required and cannot be null."); + } + Validator.validate(tokenUpdateParameters); + final String apiVersion = "2019-05-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, tokenName, apiVersion, tokenUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the TokenInner object if successful. + */ + public TokenInner beginUpdate(String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @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 tokenName, TokenUpdateParameters tokenUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters), serviceCallback); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TokenInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, tokenName, tokenUpdateParameters).map(new Func1, TokenInner>() { + @Override + public TokenInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a token 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 tokenName The name of the token. + * @param tokenUpdateParameters The parameters for updating a token. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the TokenInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String tokenName, TokenUpdateParameters tokenUpdateParameters) { + 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 (tokenName == null) { + throw new IllegalArgumentException("Parameter tokenName is required and cannot be null."); + } + if (tokenUpdateParameters == null) { + throw new IllegalArgumentException("Parameter tokenUpdateParameters is required and cannot be null."); + } + Validator.validate(tokenUpdateParameters); + final String apiVersion = "2019-05-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, tokenName, apiVersion, tokenUpdateParameters, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the tokens for the 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 CloudException 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<TokenInner> 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 tokens for the 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 tokens for the 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<TokenInner> 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 tokens for the 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<TokenInner> 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 tokens for the 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<TokenInner> 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."); + } + final String apiVersion = "2019-05-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the tokens for the specified container registry. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<TokenInner> 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 tokens for the 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 tokens for the 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<TokenInner> 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 tokens for the 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<TokenInner> 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 tokens for the 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<TokenInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhookImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhookImpl.java new file mode 100644 index 000000000000..8da61859bd9c --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhookImpl.java @@ -0,0 +1,222 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Webhook; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.WebhookUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.WebhookStatus; +import rx.functions.Func1; + +class WebhookImpl extends CreatableUpdatableImpl implements Webhook, Webhook.Definition, Webhook.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String webhookName; + private WebhookCreateParameters createParameter; + private WebhookUpdateParameters updateParameter; + + WebhookImpl(String name, ContainerRegistryManager manager) { + super(name, new WebhookInner()); + this.manager = manager; + // Set resource name + this.webhookName = name; + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + WebhookImpl(WebhookInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.webhookName = inner.name(); + // set resource ancestor and positional variables + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.webhookName = IdParsingUtils.getValueFromIdByName(inner.id(), "webhooks"); + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.createAsync(this.resourceGroupName, this.registryName, this.webhookName, this.createParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.webhookName, this.updateParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.getAsync(this.resourceGroupName, this.registryName, this.webhookName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public List actions() { + return this.inner().actions(); + } + + @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 ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public WebhookStatus status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WebhookImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public WebhookImpl withLocation(String location) { + this.createParameter.withLocation(location); + return this; + } + + @Override + public WebhookImpl withActions(List actions) { + if (isInCreateMode()) { + this.createParameter.withActions(actions); + } else { + this.updateParameter.withActions(actions); + } + return this; + } + + @Override + public WebhookImpl withServiceUri(String serviceUri) { + if (isInCreateMode()) { + this.createParameter.withServiceUri(serviceUri); + } else { + this.updateParameter.withServiceUri(serviceUri); + } + return this; + } + + @Override + public WebhookImpl withCustomHeaders(Map customHeaders) { + if (isInCreateMode()) { + this.createParameter.withCustomHeaders(customHeaders); + } else { + this.updateParameter.withCustomHeaders(customHeaders); + } + return this; + } + + @Override + public WebhookImpl withScope(String scope) { + if (isInCreateMode()) { + this.createParameter.withScope(scope); + } else { + this.updateParameter.withScope(scope); + } + return this; + } + + @Override + public WebhookImpl withStatus(WebhookStatus status) { + if (isInCreateMode()) { + this.createParameter.withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + + @Override + public WebhookImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameter.withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhookInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhookInner.java new file mode 100644 index 000000000000..0180a6119c81 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhookInner.java @@ -0,0 +1,123 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.WebhookStatus; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a webhook for a container registry. + */ +@JsonFlatten +public class WebhookInner extends Resource { + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * The provisioning state of the webhook at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the provisioning state of the webhook at the time the operation was called. 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_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhooksImpl.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhooksImpl.java new file mode 100644 index 000000000000..d2bc3b032484 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhooksImpl.java @@ -0,0 +1,130 @@ +/** + * 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_12_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Webhooks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.EventInfo; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.CallbackConfig; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Event; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Webhook; + +class WebhooksImpl extends WrapperImpl implements Webhooks { + private final ContainerRegistryManager manager; + + WebhooksImpl(ContainerRegistryManager manager) { + super(manager.inner().webhooks()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public WebhookImpl define(String name) { + return wrapModel(name); + } + + private WebhookImpl wrapModel(WebhookInner inner) { + return new WebhookImpl(inner, manager()); + } + + private WebhookImpl wrapModel(String name) { + return new WebhookImpl(name, this.manager()); + } + + @Override + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.pingAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public EventInfo call(EventInfoInner inner) { + return new EventInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getCallbackConfigAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public CallbackConfig call(CallbackConfigInner inner) { + return new CallbackConfigImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + WebhooksInner client = this.inner(); + return client.listEventsAsync(resourceGroupName, registryName, webhookName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Event call(EventInner inner) { + return new EventImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + WebhooksInner 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 Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, webhookName) + .flatMap(new Func1>() { + @Override + public Observable call(WebhookInner inner) { + if (inner == null) { + return Observable.empty(); + } else { + return Observable.just((Webhook)wrapModel(inner)); + } + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, webhookName).toCompletable(); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhooksInner.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhooksInner.java new file mode 100644 index 000000000000..2d9ddecaf474 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/WebhooksInner.java @@ -0,0 +1,1396 @@ +/** + * 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_12_01_preview.implementation; + +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_12_01_preview.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2019_12_01_preview.WebhookUpdateParameters; +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 Webhooks. + */ +public class WebhooksInner { + /** The Retrofit service to perform REST calls. */ + private WebhooksService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of WebhooksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebhooksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(WebhooksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Webhooks to be + * used by Retrofit to perform actually REST calls. + */ + interface WebhooksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2019_12_01_preview.Webhooks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @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_12_01_preview.Webhooks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @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_12_01_preview.Webhooks beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @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_12_01_preview.Webhooks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @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_12_01_preview.Webhooks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @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_12_01_preview.Webhooks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @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_12_01_preview.Webhooks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @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_12_01_preview.Webhooks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks") + 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_12_01_preview.Webhooks ping" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping") + Observable> ping(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @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_12_01_preview.Webhooks getCallbackConfig" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig") + Observable> getCallbackConfig(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @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_12_01_preview.Webhooks listEvents" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents") + Observable> listEvents(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @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_12_01_preview.Webhooks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @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_12_01_preview.Webhooks listEventsNext" }) + @GET + Observable> listEventsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner get(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @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 webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a webhook 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 webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner create(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a webhook 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 webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @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 webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook 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 webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook 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 webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookCreateParameters == null) { + throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); + } + Validator.validate(webhookCreateParameters); + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a webhook 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 webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginCreate(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a webhook 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 webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @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 webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook 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 webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook 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 webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookCreateParameters == null) { + throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); + } + Validator.validate(webhookCreateParameters); + final String apiVersion = "2019-12-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookCreateParameters, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a webhook from a 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 webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 webhookName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().last().body(); + } + + /** + * Deletes a webhook from a 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 webhookName The name of the webhook. + * @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 webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a 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 webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a 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 webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a webhook from a 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 webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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 webhookName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Deletes a webhook from a 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 webhookName The name of the webhook. + * @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 webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a 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 webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String webhookName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a 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 webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, 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 CloudException, 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) + .build(response); + } + + /** + * Updates a webhook 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 webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner update(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a webhook 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 webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @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 webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook 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 webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook 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 webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookUpdateParameters == null) { + throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); + } + Validator.validate(webhookUpdateParameters); + final String apiVersion = "2019-12-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a webhook 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 webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginUpdate(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a webhook 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 webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @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 webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook 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 webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook 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 webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookUpdateParameters == null) { + throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); + } + Validator.validate(webhookUpdateParameters); + final String apiVersion = "2019-12-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookUpdateParameters, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the 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 CloudException 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<WebhookInner> 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 webhooks for the 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 webhooks for the 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<WebhookInner> 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 webhooks for the 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<WebhookInner> 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 webhooks for the 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<WebhookInner> 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."); + } + final String apiVersion = "2019-12-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventInfoInner object if successful. + */ + public EventInfoInner ping(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @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 pingAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, EventInfoInner>() { + @Override + public EventInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable> pingWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.ping(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = pingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse pingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CallbackConfigInner object if successful. + */ + public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @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 getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, CallbackConfigInner>() { + @Override + public CallbackConfigInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable> getCallbackConfigWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.getCallbackConfig(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCallbackConfigDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCallbackConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException 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<EventInner> object if successful. + */ + public PagedList listEvents(final String resourceGroupName, final String registryName, final String webhookName) { + ServiceResponse> response = listEventsSinglePageAsync(resourceGroupName, registryName, webhookName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @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> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsSinglePageAsync(resourceGroupName, registryName, webhookName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsWithServiceResponseAsync(resourceGroupName, registryName, webhookName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsSinglePageAsync(resourceGroupName, registryName, webhookName) + .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(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + ServiceResponse> * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsSinglePageAsync(final String resourceGroupName, final String registryName, final String webhookName) { + 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 (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "2019-12-01-preview"; + return service.listEvents(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> 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 webhooks for the 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 webhooks for the 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<WebhookInner> 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 webhooks for the 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<WebhookInner> 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 webhooks for the 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<WebhookInner> 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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @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 RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEventsNext(final String nextPageLink) { + ServiceResponse> response = listEventsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @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> listEventsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @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<EventInner> object + */ + public Observable> listEventsNextAsync(final String nextPageLink) { + return listEventsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @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<EventInner> object + */ + public Observable>> listEventsNextWithServiceResponseAsync(final String nextPageLink) { + return listEventsNextSinglePageAsync(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(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsNextSinglePageAsync(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.listEventsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/package-info.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/package-info.java new file mode 100644 index 000000000000..338345c0bfea --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the implementation classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2019_12_01_preview.implementation; diff --git a/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/package-info.java b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/package-info.java new file mode 100644 index 000000000000..88cb22726851 --- /dev/null +++ b/sdk/containerregistry/mgmt-v2019_12_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2019_12_01_preview/package-info.java @@ -0,0 +1,10 @@ +// 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. + +/** + * This package contains the classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2019_12_01_preview;