From e1ad99675b5ab36199d49b53874c31c6d8f2acc6 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 14 Mar 2018 16:32:37 +0000 Subject: [PATCH 1/5] Generated from 18b9c463c9c7cb66d53dda5df37330f2deb7b8ef API updates for base image dependencies --- .../management/containerregistry/Target.java | 2 +- .../implementation/WebhooksInner.java | 30 +++++++++---------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/Target.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/Target.java index e56e2d7e691..5f14e5722de 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/Target.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/Target.java @@ -28,7 +28,7 @@ public class Target { /** * The digest of the content, as defined by the Registry V2 HTTP API - * Specificiation. + * Specification. */ @JsonProperty(value = "digest") private String digest; diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java index 70a2b4c7ed3..c7b23fd8161 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java @@ -39,7 +39,7 @@ /** * An instance of this class provides access to all the operations defined - * in WebhookOperations. + * in Webhooks. */ public class WebhooksInner { /** The Retrofit service to perform REST calls. */ @@ -59,59 +59,59 @@ public WebhooksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl cl } /** - * The interface defining all the services for WebhookOperations to be + * 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.WebhookOperations get" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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.WebhookOperations create" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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 WebhookCreateParametersInner 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.WebhookOperations beginCreate" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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 WebhookCreateParametersInner 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.WebhookOperations delete" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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.WebhookOperations beginDelete" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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.WebhookOperations update" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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 WebhookUpdateParametersInner 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.WebhookOperations beginUpdate" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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 WebhookUpdateParametersInner 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.WebhookOperations list" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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.WebhookOperations ping" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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.WebhookOperations getCallbackConfig" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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.WebhookOperations listEvents" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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.WebhookOperations listNext" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.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.WebhookOperations listEventsNext" }) + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.Webhooks listEventsNext" }) @GET Observable> listEventsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); From b030c5b1f4b9525cae0c5831b2980333c57d029a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 20 Apr 2018 01:47:18 +0000 Subject: [PATCH 2/5] Generated from 8e3c1b45d0234eeebeab1d7ebdcc2a30ce1d7179 A few improvements and fixes (#4) * A few improvements and fixes * Fix the description for build arguments * Remove error schema * use 2017-10-01 tag * Add default response back --- .../BaseImageDependency.java | 148 ++ .../BaseImageDependencyType.java | 41 + .../BaseImageTriggerType.java | 44 + .../containerregistry/BuildFilter.java | 229 +++ .../containerregistry/BuildStatus.java | 59 + .../BuildStepPropertiesUpdateParameters.java | 24 + .../BuildTaskBuildRequest.java | 48 + .../containerregistry/BuildTaskFilter.java | 43 + .../containerregistry/BuildTaskStatus.java | 41 + .../containerregistry/BuildType.java | 41 + .../BuildUpdateParameters.java | 43 + .../containerregistry/DockerBuildStep.java | 250 +++ .../DockerBuildStepUpdateParameters.java | 234 +++ .../management/containerregistry/Error.java | 69 + .../containerregistry/ErrorResponse.java | 43 + .../containerregistry/GitCommitTrigger.java | 147 ++ .../containerregistry/ImageDescriptor.java | 121 ++ .../containerregistry/ImageUpdateTrigger.java | 97 ++ .../management/containerregistry/OsType.java | 41 + .../containerregistry/PlatformProperties.java | 71 + .../containerregistry/ProxyResource.java | 63 + .../containerregistry/QuickBuildRequest.java | 238 +++ .../SourceControlAuthInfo.java | 147 ++ .../containerregistry/SourceControlType.java | 41 + .../SourceRepositoryUpdateParameters.java | 70 + .../containerregistry/TokenType.java | 41 + .../implementation/BuildArgumentInner.java | 129 ++ .../BuildGetLogResultInner.java | 43 + .../implementation/BuildInner.java | 396 +++++ .../implementation/BuildStepInner.java | 44 + .../BuildStepPropertiesInner.java | 42 + .../BuildStepUpdateParametersInner.java | 71 + .../implementation/BuildStepsInner.java | 1443 +++++++++++++++++ .../implementation/BuildTaskInner.java | 187 +++ .../BuildTaskUpdateParametersInner.java | 180 ++ .../implementation/BuildTasksInner.java | 1177 ++++++++++++++ .../implementation/BuildsInner.java | 1149 +++++++++++++ ...ContainerRegistryManagementClientImpl.java | 57 +- .../implementation/OperationsInner.java | 8 +- .../QueueBuildRequestInner.java | 25 + .../implementation/RegistriesInner.java | 342 +++- .../implementation/ReplicationsInner.java | 60 +- .../SourceRepositoryPropertiesInner.java | 125 ++ .../SourceUploadDefinitionInner.java | 70 + .../implementation/WebhooksInner.java | 66 +- 45 files changed, 7893 insertions(+), 155 deletions(-) create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageDependency.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageDependencyType.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageTriggerType.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildFilter.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildStatus.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildStepPropertiesUpdateParameters.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskBuildRequest.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskFilter.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskStatus.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildType.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildUpdateParameters.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/DockerBuildStep.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/DockerBuildStepUpdateParameters.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/Error.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ErrorResponse.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/GitCommitTrigger.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImageDescriptor.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImageUpdateTrigger.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/OsType.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/PlatformProperties.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ProxyResource.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/QuickBuildRequest.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceControlAuthInfo.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceControlType.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceRepositoryUpdateParameters.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/TokenType.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildArgumentInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildGetLogResultInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepPropertiesInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepUpdateParametersInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepsInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTaskInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTaskUpdateParametersInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTasksInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildsInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/QueueBuildRequestInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/SourceRepositoryPropertiesInner.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/SourceUploadDefinitionInner.java diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageDependency.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageDependency.java new file mode 100644 index 00000000000..73a741a24c5 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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; + +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 value. + * + * @return the type value + */ + public BaseImageDependencyType type() { + return this.type; + } + + /** + * Set the type value. + * + * @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 value. + * + * @return the registry value + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry value. + * + * @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 value. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository value. + * + * @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 value. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag value. + * + * @param tag the tag value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the digest value. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest value. + * + * @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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageDependencyType.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageDependencyType.java new file mode 100644 index 00000000000..d4e90c0a636 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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; + +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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageTriggerType.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageTriggerType.java new file mode 100644 index 00000000000..7c990752f54 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BaseImageTriggerType.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; + +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"); + + /** Static value None for BaseImageTriggerType. */ + public static final BaseImageTriggerType NONE = fromString("None"); + + /** + * 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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildFilter.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildFilter.java new file mode 100644 index 00000000000..9fa350a165b --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildFilter.java @@ -0,0 +1,229 @@ +/** + * 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; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that are enabled for Odata querying. + */ +public class BuildFilter { + /** + * The unique identifier for the build. + */ + @JsonProperty(value = "buildId") + private String buildId; + + /** + * The type of build. Possible values include: 'AutoBuild', 'QuickBuild'. + */ + @JsonProperty(value = "buildType") + private BuildType buildType; + + /** + * The current status of the build. Possible values include: 'Queued', + * 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + * 'AbandonedAsSystemError', 'Timeout'. + */ + @JsonProperty(value = "status") + private BuildStatus status; + + /** + * The create time for a build. + */ + @JsonProperty(value = "createTime") + private DateTime createTime; + + /** + * The time the build finished. + */ + @JsonProperty(value = "finishTime") + private DateTime finishTime; + + /** + * The list of all images that were generated from the build. + */ + @JsonProperty(value = "outputImageNames") + private List outputImageNames; + + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * The name of the build task that the build corresponds to. + */ + @JsonProperty(value = "buildTaskName") + private String buildTaskName; + + /** + * Get the buildId value. + * + * @return the buildId value + */ + public String buildId() { + return this.buildId; + } + + /** + * Set the buildId value. + * + * @param buildId the buildId value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withBuildId(String buildId) { + this.buildId = buildId; + return this; + } + + /** + * Get the buildType value. + * + * @return the buildType value + */ + public BuildType buildType() { + return this.buildType; + } + + /** + * Set the buildType value. + * + * @param buildType the buildType value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withBuildType(BuildType buildType) { + this.buildType = buildType; + return this; + } + + /** + * Get the status value. + * + * @return the status value + */ + public BuildStatus status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withStatus(BuildStatus status) { + this.status = status; + return this; + } + + /** + * Get the createTime value. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the createTime value. + * + * @param createTime the createTime value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the finishTime value. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the finishTime value. + * + * @param finishTime the finishTime value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the outputImageNames value. + * + * @return the outputImageNames value + */ + public List outputImageNames() { + return this.outputImageNames; + } + + /** + * Set the outputImageNames value. + * + * @param outputImageNames the outputImageNames value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withOutputImageNames(List outputImageNames) { + this.outputImageNames = outputImageNames; + return this; + } + + /** + * Get the isArchiveEnabled value. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the isArchiveEnabled value. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the buildTaskName value. + * + * @return the buildTaskName value + */ + public String buildTaskName() { + return this.buildTaskName; + } + + /** + * Set the buildTaskName value. + * + * @param buildTaskName the buildTaskName value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withBuildTaskName(String buildTaskName) { + this.buildTaskName = buildTaskName; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildStatus.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildStatus.java new file mode 100644 index 00000000000..8fabd20799b --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildStatus.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; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BuildStatus. + */ +public final class BuildStatus extends ExpandableStringEnum { + /** Static value Queued for BuildStatus. */ + public static final BuildStatus QUEUED = fromString("Queued"); + + /** Static value Started for BuildStatus. */ + public static final BuildStatus STARTED = fromString("Started"); + + /** Static value Running for BuildStatus. */ + public static final BuildStatus RUNNING = fromString("Running"); + + /** Static value Succeeded for BuildStatus. */ + public static final BuildStatus SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for BuildStatus. */ + public static final BuildStatus FAILED = fromString("Failed"); + + /** Static value Canceled for BuildStatus. */ + public static final BuildStatus CANCELED = fromString("Canceled"); + + /** Static value AbandonedAsSystemError for BuildStatus. */ + public static final BuildStatus ABANDONED_AS_SYSTEM_ERROR = fromString("AbandonedAsSystemError"); + + /** Static value Timeout for BuildStatus. */ + public static final BuildStatus TIMEOUT = fromString("Timeout"); + + /** + * Creates or finds a BuildStatus from its string representation. + * @param name a name to look for + * @return the corresponding BuildStatus + */ + @JsonCreator + public static BuildStatus fromString(String name) { + return fromString(name, BuildStatus.class); + } + + /** + * @return known BuildStatus values + */ + public static Collection values() { + return values(BuildStatus.class); + } +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildStepPropertiesUpdateParameters.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildStepPropertiesUpdateParameters.java new file mode 100644 index 00000000000..6206c38ad4a --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildStepPropertiesUpdateParameters.java @@ -0,0 +1,24 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The properties for updating a build step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("BuildStepPropertiesUpdateParameters") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Docker", value = DockerBuildStepUpdateParameters.class) +}) +public class BuildStepPropertiesUpdateParameters { +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskBuildRequest.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskBuildRequest.java new file mode 100644 index 00000000000..7683813f932 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskBuildRequest.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; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.containerregistry.implementation.QueueBuildRequestInner; + +/** + * The queue build parameters based on a build task. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("BuildTask") +public class BuildTaskBuildRequest extends QueueBuildRequestInner { + /** + * The name of build task against which build has to be queued. + */ + @JsonProperty(value = "buildTaskName", required = true) + private String buildTaskName; + + /** + * Get the buildTaskName value. + * + * @return the buildTaskName value + */ + public String buildTaskName() { + return this.buildTaskName; + } + + /** + * Set the buildTaskName value. + * + * @param buildTaskName the buildTaskName value to set + * @return the BuildTaskBuildRequest object itself. + */ + public BuildTaskBuildRequest withBuildTaskName(String buildTaskName) { + this.buildTaskName = buildTaskName; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskFilter.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskFilter.java new file mode 100644 index 00000000000..6e29457c08b --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskFilter.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The filter that can be used for listing build tasks. + */ +public class BuildTaskFilter { + /** + * The alternative name for build task. + */ + @JsonProperty(value = "alias") + private String alias; + + /** + * Get the alias value. + * + * @return the alias value + */ + public String alias() { + return this.alias; + } + + /** + * Set the alias value. + * + * @param alias the alias value to set + * @return the BuildTaskFilter object itself. + */ + public BuildTaskFilter withAlias(String alias) { + this.alias = alias; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskStatus.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskStatus.java new file mode 100644 index 00000000000..478642a5b2d --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildTaskStatus.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; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BuildTaskStatus. + */ +public final class BuildTaskStatus extends ExpandableStringEnum { + /** Static value Disabled for BuildTaskStatus. */ + public static final BuildTaskStatus DISABLED = fromString("Disabled"); + + /** Static value Enabled for BuildTaskStatus. */ + public static final BuildTaskStatus ENABLED = fromString("Enabled"); + + /** + * Creates or finds a BuildTaskStatus from its string representation. + * @param name a name to look for + * @return the corresponding BuildTaskStatus + */ + @JsonCreator + public static BuildTaskStatus fromString(String name) { + return fromString(name, BuildTaskStatus.class); + } + + /** + * @return known BuildTaskStatus values + */ + public static Collection values() { + return values(BuildTaskStatus.class); + } +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildType.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildType.java new file mode 100644 index 00000000000..d467108249c --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildType.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; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BuildType. + */ +public final class BuildType extends ExpandableStringEnum { + /** Static value AutoBuild for BuildType. */ + public static final BuildType AUTO_BUILD = fromString("AutoBuild"); + + /** Static value QuickBuild for BuildType. */ + public static final BuildType QUICK_BUILD = fromString("QuickBuild"); + + /** + * Creates or finds a BuildType from its string representation. + * @param name a name to look for + * @return the corresponding BuildType + */ + @JsonCreator + public static BuildType fromString(String name) { + return fromString(name, BuildType.class); + } + + /** + * @return known BuildType values + */ + public static Collection values() { + return values(BuildType.class); + } +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildUpdateParameters.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildUpdateParameters.java new file mode 100644 index 00000000000..76d13940842 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/BuildUpdateParameters.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The set of build properties that can be updated. + */ +public class BuildUpdateParameters { + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * Get the isArchiveEnabled value. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the isArchiveEnabled value. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the BuildUpdateParameters object itself. + */ + public BuildUpdateParameters withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/DockerBuildStep.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/DockerBuildStep.java new file mode 100644 index 00000000000..760670d0022 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/DockerBuildStep.java @@ -0,0 +1,250 @@ +/** + * 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; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.implementation.BuildArgumentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.containerregistry.implementation.BuildStepPropertiesInner; + +/** + * The Docker build step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Docker") +public class DockerBuildStep extends BuildStepPropertiesInner { + /** + * The repository branch name. + */ + @JsonProperty(value = "branch") + private String branch; + + /** + * 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 control root. + */ + @JsonProperty(value = "dockerFilePath") + private String dockerFilePath; + + /** + * The relative context path for a docker build in the source. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /** + * The custom arguments for building this build step. + */ + @JsonProperty(value = "buildArguments") + private List buildArguments; + + /** + * List of base image dependencies for a step. + */ + @JsonProperty(value = "baseImageDependencies", access = JsonProperty.Access.WRITE_ONLY) + private List baseImageDependencies; + + /** + * The type of the auto trigger for base image dependency updates. Possible + * values include: 'All', 'Runtime', 'None'. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTriggerType baseImageTrigger; + + /** + * Get the branch value. + * + * @return the branch value + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch value. + * + * @param branch the branch value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the imageNames value. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the imageNames value. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the isPushEnabled value. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the isPushEnabled value. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the noCache value. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the noCache value. + * + * @param noCache the noCache value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the dockerFilePath value. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the dockerFilePath value. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the contextPath value. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the contextPath value. + * + * @param contextPath the contextPath value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the buildArguments value. + * + * @return the buildArguments value + */ + public List buildArguments() { + return this.buildArguments; + } + + /** + * Set the buildArguments value. + * + * @param buildArguments the buildArguments value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withBuildArguments(List buildArguments) { + this.buildArguments = buildArguments; + return this; + } + + /** + * Get the baseImageDependencies value. + * + * @return the baseImageDependencies value + */ + public List baseImageDependencies() { + return this.baseImageDependencies; + } + + /** + * Get the baseImageTrigger value. + * + * @return the baseImageTrigger value + */ + public BaseImageTriggerType baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the baseImageTrigger value. + * + * @param baseImageTrigger the baseImageTrigger value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withBaseImageTrigger(BaseImageTriggerType baseImageTrigger) { + this.baseImageTrigger = baseImageTrigger; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/DockerBuildStepUpdateParameters.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/DockerBuildStepUpdateParameters.java new file mode 100644 index 00000000000..bb6a8016fa1 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/DockerBuildStepUpdateParameters.java @@ -0,0 +1,234 @@ +/** + * 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; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.implementation.BuildArgumentInner; +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") +@JsonTypeName("Docker") +public class DockerBuildStepUpdateParameters extends BuildStepPropertiesUpdateParameters { + /** + * The repository branch name. + */ + @JsonProperty(value = "branch") + private String branch; + + /** + * 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 control root. + */ + @JsonProperty(value = "dockerFilePath") + private String dockerFilePath; + + /** + * The relative context path for a docker build in the source. + */ + @JsonProperty(value = "contextPath") + private String contextPath; + + /** + * The custom arguments for building this build step. + */ + @JsonProperty(value = "buildArguments") + private List buildArguments; + + /** + * The type of the auto trigger for base image dependency updates. Possible + * values include: 'All', 'Runtime', 'None'. + */ + @JsonProperty(value = "baseImageTrigger") + private BaseImageTriggerType baseImageTrigger; + + /** + * Get the branch value. + * + * @return the branch value + */ + public String branch() { + return this.branch; + } + + /** + * Set the branch value. + * + * @param branch the branch value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the imageNames value. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the imageNames value. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the isPushEnabled value. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the isPushEnabled value. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the noCache value. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the noCache value. + * + * @param noCache the noCache value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the dockerFilePath value. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the dockerFilePath value. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the contextPath value. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the contextPath value. + * + * @param contextPath the contextPath value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the buildArguments value. + * + * @return the buildArguments value + */ + public List buildArguments() { + return this.buildArguments; + } + + /** + * Set the buildArguments value. + * + * @param buildArguments the buildArguments value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withBuildArguments(List buildArguments) { + this.buildArguments = buildArguments; + return this; + } + + /** + * Get the baseImageTrigger value. + * + * @return the baseImageTrigger value + */ + public BaseImageTriggerType baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the baseImageTrigger value. + * + * @param baseImageTrigger the baseImageTrigger value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withBaseImageTrigger(BaseImageTriggerType baseImageTrigger) { + this.baseImageTrigger = baseImageTrigger; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/Error.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/Error.java new file mode 100644 index 00000000000..fbf9840505c --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure container registry build API error body. + */ +public class Error { + /** + * error code. + */ + @JsonProperty(value = "code", required = true) + private String code; + + /** + * error message. + */ + @JsonProperty(value = "message", required = true) + private String message; + + /** + * Get the code value. + * + * @return the code value + */ + public String code() { + return this.code; + } + + /** + * Set the code value. + * + * @param code the code value to set + * @return the Error object itself. + */ + public Error withCode(String code) { + this.code = code; + return this; + } + + /** + * Get the message value. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set the message value. + * + * @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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ErrorResponse.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ErrorResponse.java new file mode 100644 index 00000000000..0f018eb808c --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ErrorResponse.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Azure container registry build API error object. + */ +public class ErrorResponse { + /** + * Azure container registry build API error body. + */ + @JsonProperty(value = "error") + private Error error; + + /** + * Get the error value. + * + * @return the error value + */ + public Error error() { + return this.error; + } + + /** + * Set the error value. + * + * @param error the error value to set + * @return the ErrorResponse object itself. + */ + public ErrorResponse withError(Error error) { + this.error = error; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/GitCommitTrigger.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/GitCommitTrigger.java new file mode 100644 index 00000000000..396f511b8b9 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/GitCommitTrigger.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The git commit trigger that caused a build. + */ +public class GitCommitTrigger { + /** + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The unique ID that identifies a commit. + */ + @JsonProperty(value = "commitId") + private String commitId; + + /** + * 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 id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withId(String id) { + this.id = id; + return this; + } + + /** + * Get the commitId value. + * + * @return the commitId value + */ + public String commitId() { + return this.commitId; + } + + /** + * Set the commitId value. + * + * @param commitId the commitId value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withCommitId(String commitId) { + this.commitId = commitId; + return this; + } + + /** + * Get the repositoryUrl value. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repositoryUrl value. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branchName value. + * + * @return the branchName value + */ + public String branchName() { + return this.branchName; + } + + /** + * Set the branchName value. + * + * @param branchName the branchName value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withBranchName(String branchName) { + this.branchName = branchName; + return this; + } + + /** + * Get the providerType value. + * + * @return the providerType value + */ + public String providerType() { + return this.providerType; + } + + /** + * Set the providerType value. + * + * @param providerType the providerType value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withProviderType(String providerType) { + this.providerType = providerType; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImageDescriptor.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImageDescriptor.java new file mode 100644 index 00000000000..d484d1c9da0 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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; + +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 value. + * + * @return the registry value + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry value. + * + * @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 value. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository value. + * + * @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 value. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag value. + * + * @param tag the tag value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the digest value. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest value. + * + * @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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImageUpdateTrigger.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImageUpdateTrigger.java new file mode 100644 index 00000000000..1bcf1926844 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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; + +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 id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @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 value. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp value. + * + * @param timestamp the timestamp value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the images value. + * + * @return the images value + */ + public List images() { + return this.images; + } + + /** + * Set the images value. + * + * @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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/OsType.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/OsType.java new file mode 100644 index 00000000000..5bff13c83b5 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/OsType.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; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for OsType. + */ +public final class OsType extends ExpandableStringEnum { + /** Static value Windows for OsType. */ + public static final OsType WINDOWS = fromString("Windows"); + + /** Static value Linux for OsType. */ + public static final OsType LINUX = fromString("Linux"); + + /** + * Creates or finds a OsType from its string representation. + * @param name a name to look for + * @return the corresponding OsType + */ + @JsonCreator + public static OsType fromString(String name) { + return fromString(name, OsType.class); + } + + /** + * @return known OsType values + */ + public static Collection values() { + return values(OsType.class); + } +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/PlatformProperties.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/PlatformProperties.java new file mode 100644 index 00000000000..97ad23f0010 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/PlatformProperties.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The platform properties against which the build has to happen. + */ +public class PlatformProperties { + /** + * The operating system type required for the build. Possible values + * include: 'Windows', 'Linux'. + */ + @JsonProperty(value = "osType", required = true) + private OsType osType; + + /** + * The CPU configuration in terms of number of cores required for the + * build. + */ + @JsonProperty(value = "cpu") + private Integer cpu; + + /** + * Get the osType value. + * + * @return the osType value + */ + public OsType osType() { + return this.osType; + } + + /** + * Set the osType value. + * + * @param osType the osType value to set + * @return the PlatformProperties object itself. + */ + public PlatformProperties withOsType(OsType osType) { + this.osType = osType; + return this; + } + + /** + * Get the cpu value. + * + * @return the cpu value + */ + public Integer cpu() { + return this.cpu; + } + + /** + * Set the cpu value. + * + * @param cpu the cpu value to set + * @return the PlatformProperties object itself. + */ + public PlatformProperties withCpu(Integer cpu) { + this.cpu = cpu; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ProxyResource.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ProxyResource.java new file mode 100644 index 00000000000..60232e6feec --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ProxyResource.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The resource model definition for a ARM proxy resource. It will have + * everything other than required location and tags. + */ +public class ProxyResource { + /** + * The resource ID. + */ + @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) + private String id; + + /** + * The name of the resource. + */ + @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) + private String name; + + /** + * The type of the resource. + */ + @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) + private String type; + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/QuickBuildRequest.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/QuickBuildRequest.java new file mode 100644 index 00000000000..52f663c6197 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/QuickBuildRequest.java @@ -0,0 +1,238 @@ +/** + * 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; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.implementation.BuildArgumentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.microsoft.azure.management.containerregistry.implementation.QueueBuildRequestInner; + +/** + * The queue build request parameters for a quick build. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("QuickBuild") +public class QuickBuildRequest extends QueueBuildRequestInner { + /** + * The fully qualified image names including the repository and tag. + */ + @JsonProperty(value = "imageNames") + private List imageNames; + + /** + * The URL(absolute or relative) of the source that needs to be built. For + * Docker build, it can be an URL to a tar or github repoistory as + * supported by Docker. + * If it is relative URL, the relative path should be obtained from calling + * getSourceUploadUrl API. + */ + @JsonProperty(value = "sourceLocation", required = true) + private String sourceLocation; + + /** + * The collection of build arguments to be used. + */ + @JsonProperty(value = "buildArguments") + private List buildArguments; + + /** + * 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; + + /** + * Build timeout in seconds. + */ + @JsonProperty(value = "timeout") + private Integer timeout; + + /** + * The platform properties against which the build will happen. + */ + @JsonProperty(value = "platform", required = true) + private PlatformProperties platform; + + /** + * The Docker file path relative to the source location. + */ + @JsonProperty(value = "dockerFilePath", required = true) + private String dockerFilePath; + + /** + * Get the imageNames value. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the imageNames value. + * + * @param imageNames the imageNames value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the sourceLocation value. + * + * @return the sourceLocation value + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set the sourceLocation value. + * + * @param sourceLocation the sourceLocation value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the buildArguments value. + * + * @return the buildArguments value + */ + public List buildArguments() { + return this.buildArguments; + } + + /** + * Set the buildArguments value. + * + * @param buildArguments the buildArguments value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withBuildArguments(List buildArguments) { + this.buildArguments = buildArguments; + return this; + } + + /** + * Get the isPushEnabled value. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the isPushEnabled value. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the noCache value. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the noCache value. + * + * @param noCache the noCache value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the platform value. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform value. + * + * @param platform the platform value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the dockerFilePath value. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the dockerFilePath value. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceControlAuthInfo.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceControlAuthInfo.java new file mode 100644 index 00000000000..795c2a725df --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceControlAuthInfo.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The authorization properties for accessing the source code repository. + */ +public class SourceControlAuthInfo { + /** + * 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", 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 tokenType value. + * + * @return the tokenType value + */ + public TokenType tokenType() { + return this.tokenType; + } + + /** + * Set the tokenType value. + * + * @param tokenType the tokenType value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withTokenType(TokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get the token value. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set the token value. + * + * @param token the token value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the refreshToken value. + * + * @return the refreshToken value + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refreshToken value. + * + * @param refreshToken the refreshToken value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the scope value. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope value. + * + * @param scope the scope value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the expiresIn value. + * + * @return the expiresIn value + */ + public Integer expiresIn() { + return this.expiresIn; + } + + /** + * Set the expiresIn value. + * + * @param expiresIn the expiresIn value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceControlType.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceControlType.java new file mode 100644 index 00000000000..6118bfab57c --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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; + +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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceRepositoryUpdateParameters.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceRepositoryUpdateParameters.java new file mode 100644 index 00000000000..f24575f701d --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/SourceRepositoryUpdateParameters.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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties for updating the source code repository configuration. + */ +public class SourceRepositoryUpdateParameters { + /** + * The authorization properties for accessing the source code repository. + */ + @JsonProperty(value = "sourceControlAuthProperties") + private SourceControlAuthInfo sourceControlAuthProperties; + + /** + * The value of this property indicates whether the source control commit + * trigger is enabled or not. + */ + @JsonProperty(value = "isCommitTriggerEnabled") + private Boolean isCommitTriggerEnabled; + + /** + * Get the sourceControlAuthProperties value. + * + * @return the sourceControlAuthProperties value + */ + public SourceControlAuthInfo sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the sourceControlAuthProperties value. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set + * @return the SourceRepositoryUpdateParameters object itself. + */ + public SourceRepositoryUpdateParameters withSourceControlAuthProperties(SourceControlAuthInfo sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + + /** + * Get the isCommitTriggerEnabled value. + * + * @return the isCommitTriggerEnabled value + */ + public Boolean isCommitTriggerEnabled() { + return this.isCommitTriggerEnabled; + } + + /** + * Set the isCommitTriggerEnabled value. + * + * @param isCommitTriggerEnabled the isCommitTriggerEnabled value to set + * @return the SourceRepositoryUpdateParameters object itself. + */ + public SourceRepositoryUpdateParameters withIsCommitTriggerEnabled(Boolean isCommitTriggerEnabled) { + this.isCommitTriggerEnabled = isCommitTriggerEnabled; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/TokenType.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/TokenType.java new file mode 100644 index 00000000000..5b92fdecb81 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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; + +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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildArgumentInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildArgumentInner.java new file mode 100644 index 00000000000..eb07e541610 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildArgumentInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties of a build argument. + */ +public class BuildArgumentInner { + /** + * The type of the argument. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * 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; + + /** + * Creates an instance of BuildArgumentInner class. + */ + public BuildArgumentInner() { + type = "DockerBuildArgument"; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the BuildArgumentInner object itself. + */ + public BuildArgumentInner withType(String type) { + this.type = type; + return this; + } + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the BuildArgumentInner object itself. + */ + public BuildArgumentInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the BuildArgumentInner object itself. + */ + public BuildArgumentInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the isSecret value. + * + * @return the isSecret value + */ + public Boolean isSecret() { + return this.isSecret; + } + + /** + * Set the isSecret value. + * + * @param isSecret the isSecret value to set + * @return the BuildArgumentInner object itself. + */ + public BuildArgumentInner withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildGetLogResultInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildGetLogResultInner.java new file mode 100644 index 00000000000..679cd3a2510 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildGetLogResultInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of get log link operation. + */ +public class BuildGetLogResultInner { + /** + * The link to logs for a azure container registry build. + */ + @JsonProperty(value = "logLink") + private String logLink; + + /** + * Get the logLink value. + * + * @return the logLink value + */ + public String logLink() { + return this.logLink; + } + + /** + * Set the logLink value. + * + * @param logLink the logLink value to set + * @return the BuildGetLogResultInner object itself. + */ + public BuildGetLogResultInner withLogLink(String logLink) { + this.logLink = logLink; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildInner.java new file mode 100644 index 00000000000..0f8585a9a5f --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildInner.java @@ -0,0 +1,396 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.containerregistry.BuildStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.BuildType; +import java.util.List; +import com.microsoft.azure.management.containerregistry.ImageDescriptor; +import com.microsoft.azure.management.containerregistry.ImageUpdateTrigger; +import com.microsoft.azure.management.containerregistry.GitCommitTrigger; +import com.microsoft.azure.management.containerregistry.PlatformProperties; +import com.microsoft.azure.management.containerregistry.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.management.containerregistry.ProxyResource; + +/** + * Build resource properties. + */ +@JsonFlatten +public class BuildInner extends ProxyResource { + /** + * The unique identifier for the build. + */ + @JsonProperty(value = "properties.buildId") + private String buildId; + + /** + * The current status of the build. Possible values include: 'Queued', + * 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', + * 'AbandonedAsSystemError', 'Timeout'. + */ + @JsonProperty(value = "properties.status") + private BuildStatus status; + + /** + * The last updated time for the build. + */ + @JsonProperty(value = "properties.lastUpdatedTime") + private DateTime lastUpdatedTime; + + /** + * The type of build. Possible values include: 'AutoBuild', 'QuickBuild'. + */ + @JsonProperty(value = "properties.buildType") + private BuildType buildType; + + /** + * The time the build was created. + */ + @JsonProperty(value = "properties.createTime") + private DateTime createTime; + + /** + * The time the build started. + */ + @JsonProperty(value = "properties.startTime") + private DateTime startTime; + + /** + * The time the build finished. + */ + @JsonProperty(value = "properties.finishTime") + private DateTime finishTime; + + /** + * The list of all images that were generated from the build. + */ + @JsonProperty(value = "properties.outputImages") + private List outputImages; + + /** + * The build task with which the build was started. + */ + @JsonProperty(value = "properties.buildTask") + private String buildTask; + + /** + * The image update trigger that caused the build. + */ + @JsonProperty(value = "properties.imageUpdateTrigger") + private ImageUpdateTrigger imageUpdateTrigger; + + /** + * The git commit trigger that caused the build. + */ + @JsonProperty(value = "properties.gitCommitTrigger") + private GitCommitTrigger gitCommitTrigger; + + /** + * The value that indicates whether archiving is enabled or not. + */ + @JsonProperty(value = "properties.isArchiveEnabled") + private Boolean isArchiveEnabled; + + /** + * The platform properties against which the build will happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformProperties platform; + + /** + * The provisioning state of a build. Possible values include: 'Creating', + * 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState") + private ProvisioningState provisioningState; + + /** + * Get the buildId value. + * + * @return the buildId value + */ + public String buildId() { + return this.buildId; + } + + /** + * Set the buildId value. + * + * @param buildId the buildId value to set + * @return the BuildInner object itself. + */ + public BuildInner withBuildId(String buildId) { + this.buildId = buildId; + return this; + } + + /** + * Get the status value. + * + * @return the status value + */ + public BuildStatus status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the BuildInner object itself. + */ + public BuildInner withStatus(BuildStatus status) { + this.status = status; + return this; + } + + /** + * Get the lastUpdatedTime value. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the lastUpdatedTime value. + * + * @param lastUpdatedTime the lastUpdatedTime value to set + * @return the BuildInner object itself. + */ + public BuildInner withLastUpdatedTime(DateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the buildType value. + * + * @return the buildType value + */ + public BuildType buildType() { + return this.buildType; + } + + /** + * Set the buildType value. + * + * @param buildType the buildType value to set + * @return the BuildInner object itself. + */ + public BuildInner withBuildType(BuildType buildType) { + this.buildType = buildType; + return this; + } + + /** + * Get the createTime value. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the createTime value. + * + * @param createTime the createTime value to set + * @return the BuildInner object itself. + */ + public BuildInner withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the startTime value. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime value. + * + * @param startTime the startTime value to set + * @return the BuildInner object itself. + */ + public BuildInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the finishTime value. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the finishTime value. + * + * @param finishTime the finishTime value to set + * @return the BuildInner object itself. + */ + public BuildInner withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the outputImages value. + * + * @return the outputImages value + */ + public List outputImages() { + return this.outputImages; + } + + /** + * Set the outputImages value. + * + * @param outputImages the outputImages value to set + * @return the BuildInner object itself. + */ + public BuildInner withOutputImages(List outputImages) { + this.outputImages = outputImages; + return this; + } + + /** + * Get the buildTask value. + * + * @return the buildTask value + */ + public String buildTask() { + return this.buildTask; + } + + /** + * Set the buildTask value. + * + * @param buildTask the buildTask value to set + * @return the BuildInner object itself. + */ + public BuildInner withBuildTask(String buildTask) { + this.buildTask = buildTask; + return this; + } + + /** + * Get the imageUpdateTrigger value. + * + * @return the imageUpdateTrigger value + */ + public ImageUpdateTrigger imageUpdateTrigger() { + return this.imageUpdateTrigger; + } + + /** + * Set the imageUpdateTrigger value. + * + * @param imageUpdateTrigger the imageUpdateTrigger value to set + * @return the BuildInner object itself. + */ + public BuildInner withImageUpdateTrigger(ImageUpdateTrigger imageUpdateTrigger) { + this.imageUpdateTrigger = imageUpdateTrigger; + return this; + } + + /** + * Get the gitCommitTrigger value. + * + * @return the gitCommitTrigger value + */ + public GitCommitTrigger gitCommitTrigger() { + return this.gitCommitTrigger; + } + + /** + * Set the gitCommitTrigger value. + * + * @param gitCommitTrigger the gitCommitTrigger value to set + * @return the BuildInner object itself. + */ + public BuildInner withGitCommitTrigger(GitCommitTrigger gitCommitTrigger) { + this.gitCommitTrigger = gitCommitTrigger; + return this; + } + + /** + * Get the isArchiveEnabled value. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the isArchiveEnabled value. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the BuildInner object itself. + */ + public BuildInner withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the platform value. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform value. + * + * @param platform the platform value to set + * @return the BuildInner object itself. + */ + public BuildInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState value. + * + * @param provisioningState the provisioningState value to set + * @return the BuildInner object itself. + */ + public BuildInner withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepInner.java new file mode 100644 index 00000000000..0ae6fb3fae6 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.management.containerregistry.ProxyResource; + +/** + * Build step resource properties. + */ +public class BuildStepInner extends ProxyResource { + /** + * The properties of a build step. + */ + @JsonProperty(value = "properties") + private BuildStepPropertiesInner properties; + + /** + * Get the properties value. + * + * @return the properties value + */ + public BuildStepPropertiesInner properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the BuildStepInner object itself. + */ + public BuildStepInner withProperties(BuildStepPropertiesInner properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepPropertiesInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepPropertiesInner.java new file mode 100644 index 00000000000..17119c2c2c8 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepPropertiesInner.java @@ -0,0 +1,42 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.containerregistry.ProvisioningState; +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 build step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("BuildStepProperties") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "Docker", value = DockerBuildStep.class) +}) +public class BuildStepPropertiesInner { + /** + * The provisioning state of the build step. Possible values include: + * 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepUpdateParametersInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepUpdateParametersInner.java new file mode 100644 index 00000000000..15808db5969 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepUpdateParametersInner.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.implementation; + +import com.microsoft.azure.management.containerregistry.BuildStepPropertiesUpdateParameters; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for updating a build step. + */ +public class BuildStepUpdateParametersInner { + /** + * The properties for updating a build step. + */ + @JsonProperty(value = "properties") + private BuildStepPropertiesUpdateParameters properties; + + /** + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the properties value. + * + * @return the properties value + */ + public BuildStepPropertiesUpdateParameters properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the BuildStepUpdateParametersInner object itself. + */ + public BuildStepUpdateParametersInner withProperties(BuildStepPropertiesUpdateParameters properties) { + this.properties = properties; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the BuildStepUpdateParametersInner object itself. + */ + public BuildStepUpdateParametersInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepsInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepsInner.java new file mode 100644 index 00000000000..9e0b46e6333 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildStepsInner.java @@ -0,0 +1,1443 @@ +/** + * 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.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.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 BuildSteps. + */ +public class BuildStepsInner { + /** The Retrofit service to perform REST calls. */ + private BuildStepsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of BuildStepsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BuildStepsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(BuildStepsService.class); + this.client = client; + } + + /** + * The interface defining all the services for BuildSteps to be + * used by Retrofit to perform actually REST calls. + */ + interface BuildStepsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.BuildSteps list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @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.BuildSteps get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Path("stepName") String stepName, @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.BuildSteps create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Path("stepName") String stepName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BuildStepInner buildStepCreateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.BuildSteps beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Path("stepName") String stepName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BuildStepInner buildStepCreateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.BuildSteps delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Path("stepName") String stepName, @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.BuildSteps beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Path("stepName") String stepName, @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.BuildSteps update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Path("stepName") String stepName, @Query("api-version") String apiVersion, @Body BuildStepUpdateParametersInner buildStepUpdateParameters, @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.BuildSteps beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Path("stepName") String stepName, @Query("api-version") String apiVersion, @Body BuildStepUpdateParametersInner buildStepUpdateParameters, @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.BuildSteps listBuildArguments" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/steps/{stepName}/listBuildArguments") + Observable> listBuildArguments(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Path("stepName") String stepName, @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.BuildSteps 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.BuildSteps listBuildArgumentsNext" }) + @GET + Observable> listBuildArgumentsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * List all the build steps for a given build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @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<BuildStepInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName, final String buildTaskName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName, buildTaskName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List all the build steps for a given build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build 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> listAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName, buildTaskName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List all the build steps for a given build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BuildStepInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName, final String buildTaskName) { + return listWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List all the build steps for a given build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BuildStepInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String buildTaskName) { + return listSinglePageAsync(resourceGroupName, registryName, buildTaskName) + .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 the build steps for a given build task. + * + 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 buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BuildStepInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName, final String buildTaskName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, 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); + } + + /** + * Gets the build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @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 BuildStepInner object if successful. + */ + public BuildStepInner get(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).toBlocking().single().body(); + } + + /** + * Gets the build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build 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 buildTaskName, String stepName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName), serviceCallback); + } + + /** + * Gets the build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildStepInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).map(new Func1, BuildStepInner>() { + @Override + public BuildStepInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildStepInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, 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 build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @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 BuildStepInner object if successful. + */ + public BuildStepInner create(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + return createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).toBlocking().last().body(); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build 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 buildTaskName, String stepName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName), serviceCallback); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + return createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).map(new Func1, BuildStepInner>() { + @Override + public BuildStepInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + final BuildStepPropertiesInner properties = null; + BuildStepInner buildStepCreateParameters = new BuildStepInner(); + buildStepCreateParameters.withProperties(null); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, apiVersion, this.client.acceptLanguage(), buildStepCreateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param properties The properties of a build step. + * @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 BuildStepInner object if successful. + */ + public BuildStepInner create(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepPropertiesInner properties) { + return createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, properties).toBlocking().last().body(); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param properties The properties of a build step. + * @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 buildTaskName, String stepName, BuildStepPropertiesInner properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, properties), serviceCallback); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param properties The properties of a build step. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepPropertiesInner properties) { + return createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, properties).map(new Func1, BuildStepInner>() { + @Override + public BuildStepInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param properties The properties of a build step. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepPropertiesInner properties) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + Validator.validate(properties); + final String apiVersion = "2018-02-01-preview"; + BuildStepInner buildStepCreateParameters = new BuildStepInner(); + buildStepCreateParameters.withProperties(properties); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, apiVersion, this.client.acceptLanguage(), buildStepCreateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @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 BuildStepInner object if successful. + */ + public BuildStepInner beginCreate(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).toBlocking().single().body(); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build 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 buildTaskName, String stepName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName), serviceCallback); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildStepInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).map(new Func1, BuildStepInner>() { + @Override + public BuildStepInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildStepInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + final BuildStepPropertiesInner properties = null; + BuildStepInner buildStepCreateParameters = new BuildStepInner(); + buildStepCreateParameters.withProperties(null); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, apiVersion, this.client.acceptLanguage(), buildStepCreateParameters, 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); + } + } + }); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param properties The properties of a build step. + * @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 BuildStepInner object if successful. + */ + public BuildStepInner beginCreate(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepPropertiesInner properties) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, properties).toBlocking().single().body(); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param properties The properties of a build step. + * @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 buildTaskName, String stepName, BuildStepPropertiesInner properties, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, properties), serviceCallback); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param properties The properties of a build step. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildStepInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepPropertiesInner properties) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, properties).map(new Func1, BuildStepInner>() { + @Override + public BuildStepInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a build step for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param properties The properties of a build step. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildStepInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepPropertiesInner properties) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + Validator.validate(properties); + final String apiVersion = "2018-02-01-preview"; + BuildStepInner buildStepCreateParameters = new BuildStepInner(); + buildStepCreateParameters.withProperties(properties); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, apiVersion, this.client.acceptLanguage(), buildStepCreateParameters, 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 build step from the build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @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 buildTaskName, String stepName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).toBlocking().last().body(); + } + + /** + * Deletes a build step from the build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build 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 buildTaskName, String stepName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName), serviceCallback); + } + + /** + * Deletes a build step from the build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a build step from the build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a build step from the build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @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 buildTaskName, String stepName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).toBlocking().single().body(); + } + + /** + * Deletes a build step from the build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build 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 buildTaskName, String stepName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName), serviceCallback); + } + + /** + * Deletes a build step from the build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a build step from the build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, 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()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a build step in a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param buildStepUpdateParameters The parameters for updating a build step. + * @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 BuildStepInner object if successful. + */ + public BuildStepInner update(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParametersInner buildStepUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, buildStepUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a build step in a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param buildStepUpdateParameters The parameters for updating a build step. + * @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 buildTaskName, String stepName, BuildStepUpdateParametersInner buildStepUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, buildStepUpdateParameters), serviceCallback); + } + + /** + * Updates a build step in a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param buildStepUpdateParameters The parameters for updating a build step. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParametersInner buildStepUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, buildStepUpdateParameters).map(new Func1, BuildStepInner>() { + @Override + public BuildStepInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a build step in a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param buildStepUpdateParameters The parameters for updating a build step. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParametersInner buildStepUpdateParameters) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + if (buildStepUpdateParameters == null) { + throw new IllegalArgumentException("Parameter buildStepUpdateParameters is required and cannot be null."); + } + Validator.validate(buildStepUpdateParameters); + final String apiVersion = "2018-02-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, apiVersion, buildStepUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a build step in a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param buildStepUpdateParameters The parameters for updating a build step. + * @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 BuildStepInner object if successful. + */ + public BuildStepInner beginUpdate(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParametersInner buildStepUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, buildStepUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a build step in a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param buildStepUpdateParameters The parameters for updating a build step. + * @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 buildTaskName, String stepName, BuildStepUpdateParametersInner buildStepUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, buildStepUpdateParameters), serviceCallback); + } + + /** + * Updates a build step in a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param buildStepUpdateParameters The parameters for updating a build step. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildStepInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParametersInner buildStepUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName, buildStepUpdateParameters).map(new Func1, BuildStepInner>() { + @Override + public BuildStepInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a build step in a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @param buildStepUpdateParameters The parameters for updating a build step. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildStepInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName, BuildStepUpdateParametersInner buildStepUpdateParameters) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + if (buildStepUpdateParameters == null) { + throw new IllegalArgumentException("Parameter buildStepUpdateParameters is required and cannot be null."); + } + Validator.validate(buildStepUpdateParameters); + final String apiVersion = "2018-02-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, apiVersion, buildStepUpdateParameters, 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); + } + + /** + * List the build arguments for a step including the secret arguments. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @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<BuildArgumentInner> object if successful. + */ + public PagedList listBuildArguments(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) { + ServiceResponse> response = listBuildArgumentsSinglePageAsync(resourceGroupName, registryName, buildTaskName, stepName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBuildArgumentsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the build arguments for a step including the secret arguments. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build 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> listBuildArgumentsAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBuildArgumentsSinglePageAsync(resourceGroupName, registryName, buildTaskName, stepName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBuildArgumentsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the build arguments for a step including the secret arguments. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BuildArgumentInner> object + */ + public Observable> listBuildArgumentsAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) { + return listBuildArgumentsWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, stepName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the build arguments for a step including the secret arguments. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BuildArgumentInner> object + */ + public Observable>> listBuildArgumentsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) { + return listBuildArgumentsSinglePageAsync(resourceGroupName, registryName, buildTaskName, stepName) + .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(listBuildArgumentsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the build arguments for a step including the secret arguments. + * + 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 buildTaskName The name of the container registry build task. + ServiceResponse> * @param stepName The name of a build step for a container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BuildArgumentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBuildArgumentsSinglePageAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (stepName == null) { + throw new IllegalArgumentException("Parameter stepName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.listBuildArguments(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, stepName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBuildArgumentsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBuildArgumentsDelegate(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 the build steps for a given build task. + * + * @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<BuildStepInner> 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 the build steps for a given build task. + * + * @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 the build steps for a given build task. + * + * @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<BuildStepInner> 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 the build steps for a given build task. + * + * @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<BuildStepInner> 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 the build steps for a given build task. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BuildStepInner> 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); + } + + /** + * List the build arguments for a step including the secret arguments. + * + * @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<BuildArgumentInner> object if successful. + */ + public PagedList listBuildArgumentsNext(final String nextPageLink) { + ServiceResponse> response = listBuildArgumentsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listBuildArgumentsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * List the build arguments for a step including the secret arguments. + * + * @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> listBuildArgumentsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listBuildArgumentsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listBuildArgumentsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * List the build arguments for a step including the secret arguments. + * + * @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<BuildArgumentInner> object + */ + public Observable> listBuildArgumentsNextAsync(final String nextPageLink) { + return listBuildArgumentsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * List the build arguments for a step including the secret arguments. + * + * @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<BuildArgumentInner> object + */ + public Observable>> listBuildArgumentsNextWithServiceResponseAsync(final String nextPageLink) { + return listBuildArgumentsNextSinglePageAsync(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(listBuildArgumentsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * List the build arguments for a step including the secret arguments. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BuildArgumentInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listBuildArgumentsNextSinglePageAsync(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.listBuildArgumentsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listBuildArgumentsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listBuildArgumentsNextDelegate(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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTaskInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTaskInner.java new file mode 100644 index 00000000000..7335f157618 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTaskInner.java @@ -0,0 +1,187 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.containerregistry.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.BuildTaskStatus; +import com.microsoft.azure.management.containerregistry.PlatformProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The build task that has the resource properties and all build items. The + * build task will have all information to schedule a build against it. + */ +@JsonFlatten +public class BuildTaskInner extends Resource { + /** + * The provisioning state of the build 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 build task. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The alternative updatable name for a build task. + */ + @JsonProperty(value = "properties.alias", required = true) + private String alias; + + /** + * The current status of build task. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "properties.status") + private BuildTaskStatus status; + + /** + * The properties that describes the source(code) for the build task. + */ + @JsonProperty(value = "properties.sourceRepository", required = true) + private SourceRepositoryPropertiesInner sourceRepository; + + /** + * The platform properties against which the build has to happen. + */ + @JsonProperty(value = "properties.platform", required = true) + private PlatformProperties platform; + + /** + * Build timeout in seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * Get the provisioningState value. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the creationDate value. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the alias value. + * + * @return the alias value + */ + public String alias() { + return this.alias; + } + + /** + * Set the alias value. + * + * @param alias the alias value to set + * @return the BuildTaskInner object itself. + */ + public BuildTaskInner withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get the status value. + * + * @return the status value + */ + public BuildTaskStatus status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the BuildTaskInner object itself. + */ + public BuildTaskInner withStatus(BuildTaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the sourceRepository value. + * + * @return the sourceRepository value + */ + public SourceRepositoryPropertiesInner sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the sourceRepository value. + * + * @param sourceRepository the sourceRepository value to set + * @return the BuildTaskInner object itself. + */ + public BuildTaskInner withSourceRepository(SourceRepositoryPropertiesInner sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the platform value. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform value. + * + * @param platform the platform value to set + * @return the BuildTaskInner object itself. + */ + public BuildTaskInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the BuildTaskInner object itself. + */ + public BuildTaskInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTaskUpdateParametersInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTaskUpdateParametersInner.java new file mode 100644 index 00000000000..f0c60cb908b --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTaskUpdateParametersInner.java @@ -0,0 +1,180 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.containerregistry.BuildTaskStatus; +import com.microsoft.azure.management.containerregistry.PlatformProperties; +import com.microsoft.azure.management.containerregistry.SourceRepositoryUpdateParameters; +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a build task. + */ +@JsonFlatten +public class BuildTaskUpdateParametersInner { + /** + * The alternative updatable name for a build task. + */ + @JsonProperty(value = "properties.alias") + private String alias; + + /** + * The current status of build task. Possible values include: 'Disabled', + * 'Enabled'. + */ + @JsonProperty(value = "properties.status") + private BuildTaskStatus status; + + /** + * The platform properties against which the build has to happen. + */ + @JsonProperty(value = "properties.platform") + private PlatformProperties platform; + + /** + * Build timeout in seconds. + */ + @JsonProperty(value = "properties.timeout") + private Integer timeout; + + /** + * The properties that describes the source(code) for the build task. + */ + @JsonProperty(value = "properties.sourceRepository") + private SourceRepositoryUpdateParameters sourceRepository; + + /** + * The ARM resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the alias value. + * + * @return the alias value + */ + public String alias() { + return this.alias; + } + + /** + * Set the alias value. + * + * @param alias the alias value to set + * @return the BuildTaskUpdateParametersInner object itself. + */ + public BuildTaskUpdateParametersInner withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get the status value. + * + * @return the status value + */ + public BuildTaskStatus status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the BuildTaskUpdateParametersInner object itself. + */ + public BuildTaskUpdateParametersInner withStatus(BuildTaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the platform value. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform value. + * + * @param platform the platform value to set + * @return the BuildTaskUpdateParametersInner object itself. + */ + public BuildTaskUpdateParametersInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the timeout value. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set the timeout value. + * + * @param timeout the timeout value to set + * @return the BuildTaskUpdateParametersInner object itself. + */ + public BuildTaskUpdateParametersInner withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the sourceRepository value. + * + * @return the sourceRepository value + */ + public SourceRepositoryUpdateParameters sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the sourceRepository value. + * + * @param sourceRepository the sourceRepository value to set + * @return the BuildTaskUpdateParametersInner object itself. + */ + public BuildTaskUpdateParametersInner withSourceRepository(SourceRepositoryUpdateParameters sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the BuildTaskUpdateParametersInner object itself. + */ + public BuildTaskUpdateParametersInner withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTasksInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTasksInner.java new file mode 100644 index 00000000000..ca50299c1e7 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildTasksInner.java @@ -0,0 +1,1177 @@ +/** + * 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.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.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 BuildTasks. + */ +public class BuildTasksInner { + /** The Retrofit service to perform REST calls. */ + private BuildTasksService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of BuildTasksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BuildTasksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(BuildTasksService.class); + this.client = client; + } + + /** + * The interface defining all the services for BuildTasks to be + * used by Retrofit to perform actually REST calls. + */ + interface BuildTasksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.BuildTasks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Query("$filter") String filter, @Query("$skipToken") String skipToken, @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.BuildTasks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @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.BuildTasks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Query("api-version") String apiVersion, @Body BuildTaskInner buildTaskCreateParameters, @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.BuildTasks beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Query("api-version") String apiVersion, @Body BuildTaskInner buildTaskCreateParameters, @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.BuildTasks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @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.BuildTasks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @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.BuildTasks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Query("api-version") String apiVersion, @Body BuildTaskUpdateParametersInner buildTaskUpdateParameters, @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.BuildTasks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @Query("api-version") String apiVersion, @Body BuildTaskUpdateParametersInner buildTaskUpdateParameters, @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.BuildTasks listSourceRepositoryProperties" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/buildTasks/{buildTaskName}/listSourceRepositoryProperties") + Observable> listSourceRepositoryProperties(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildTaskName") String buildTaskName, @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.BuildTasks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all the build 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 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<BuildTaskInner> 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 build 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 build 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<BuildTaskInner> 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 build 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<BuildTaskInner> 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 build 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 PagedList<BuildTaskInner> 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 = "2018-02-01-preview"; + final String filter = null; + final String skipToken = null; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, filter, skipToken, 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); + } + } + }); + } + + /** + * Lists all the build 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 filter The build task filter to apply on the operation. + * @param skipToken $skipToken is supported on get list of build tasks, which provides the next page in the list of tasks. + * @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<BuildTaskInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName, final String filter, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName, filter, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the build 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 filter The build task filter to apply on the operation. + * @param skipToken $skipToken is supported on get list of build tasks, which provides the next page in the list of tasks. + * @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 String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName, filter, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the build 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 filter The build task filter to apply on the operation. + * @param skipToken $skipToken is supported on get list of build tasks, which provides the next page in the list of tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BuildTaskInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName, final String filter, final String skipToken) { + return listWithServiceResponseAsync(resourceGroupName, registryName, filter, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the build 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 filter The build task filter to apply on the operation. + * @param skipToken $skipToken is supported on get list of build tasks, which provides the next page in the list of tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BuildTaskInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String filter, final String skipToken) { + return listSinglePageAsync(resourceGroupName, registryName, filter, skipToken) + .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 build 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. + ServiceResponse> * @param filter The build task filter to apply on the operation. + ServiceResponse> * @param skipToken $skipToken is supported on get list of build tasks, which provides the next page in the list of tasks. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BuildTaskInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName, final String filter, final String skipToken) { + 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 = "2018-02-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, filter, skipToken, 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); + } + + /** + * Get the properties of a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @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 BuildTaskInner object if successful. + */ + public BuildTaskInner get(String resourceGroupName, String registryName, String buildTaskName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).toBlocking().single().body(); + } + + /** + * Get the properties of a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build 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 buildTaskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName), serviceCallback); + } + + /** + * Get the properties of a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildTaskInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String buildTaskName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).map(new Func1, BuildTaskInner>() { + @Override + public BuildTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the properties of a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildTaskInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, 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 build 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 buildTaskName The name of the container registry build task. + * @param buildTaskCreateParameters The parameters for creating a build task. + * @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 BuildTaskInner object if successful. + */ + public BuildTaskInner create(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskCreateParameters The parameters for creating a build 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 buildTaskName, BuildTaskInner buildTaskCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters), serviceCallback); + } + + /** + * Creates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskCreateParameters The parameters for creating a build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters).map(new Func1, BuildTaskInner>() { + @Override + public BuildTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskCreateParameters The parameters for creating a build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (buildTaskCreateParameters == null) { + throw new IllegalArgumentException("Parameter buildTaskCreateParameters is required and cannot be null."); + } + Validator.validate(buildTaskCreateParameters); + final String apiVersion = "2018-02-01-preview"; + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, apiVersion, buildTaskCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskCreateParameters The parameters for creating a build task. + * @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 BuildTaskInner object if successful. + */ + public BuildTaskInner beginCreate(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskCreateParameters The parameters for creating a build 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 buildTaskName, BuildTaskInner buildTaskCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters), serviceCallback); + } + + /** + * Creates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskCreateParameters The parameters for creating a build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildTaskInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskCreateParameters).map(new Func1, BuildTaskInner>() { + @Override + public BuildTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskCreateParameters The parameters for creating a build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildTaskInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskInner buildTaskCreateParameters) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (buildTaskCreateParameters == null) { + throw new IllegalArgumentException("Parameter buildTaskCreateParameters is required and cannot be null."); + } + Validator.validate(buildTaskCreateParameters); + final String apiVersion = "2018-02-01-preview"; + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, apiVersion, buildTaskCreateParameters, 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 specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @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 buildTaskName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).toBlocking().last().body(); + } + + /** + * Deletes a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build 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 buildTaskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName), serviceCallback); + } + + /** + * Deletes a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String buildTaskName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Deletes a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @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 buildTaskName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).toBlocking().single().body(); + } + + /** + * Deletes a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build 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 buildTaskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName), serviceCallback); + } + + /** + * Deletes a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String buildTaskName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a specified build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, 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 build 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 buildTaskName The name of the container registry build task. + * @param buildTaskUpdateParameters The parameters for updating a build task. + * @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 BuildTaskInner object if successful. + */ + public BuildTaskInner update(String resourceGroupName, String registryName, String buildTaskName, BuildTaskUpdateParametersInner buildTaskUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskUpdateParameters The parameters for updating a build 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 buildTaskName, BuildTaskUpdateParametersInner buildTaskUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskUpdateParameters), serviceCallback); + } + + /** + * Updates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskUpdateParameters The parameters for updating a build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskUpdateParametersInner buildTaskUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskUpdateParameters).map(new Func1, BuildTaskInner>() { + @Override + public BuildTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskUpdateParameters The parameters for updating a build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskUpdateParametersInner buildTaskUpdateParameters) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (buildTaskUpdateParameters == null) { + throw new IllegalArgumentException("Parameter buildTaskUpdateParameters is required and cannot be null."); + } + Validator.validate(buildTaskUpdateParameters); + final String apiVersion = "2018-02-01-preview"; + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, apiVersion, buildTaskUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskUpdateParameters The parameters for updating a build task. + * @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 BuildTaskInner object if successful. + */ + public BuildTaskInner beginUpdate(String resourceGroupName, String registryName, String buildTaskName, BuildTaskUpdateParametersInner buildTaskUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskUpdateParameters The parameters for updating a build 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 buildTaskName, BuildTaskUpdateParametersInner buildTaskUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskUpdateParameters), serviceCallback); + } + + /** + * Updates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskUpdateParameters The parameters for updating a build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildTaskInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskUpdateParametersInner buildTaskUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName, buildTaskUpdateParameters).map(new Func1, BuildTaskInner>() { + @Override + public BuildTaskInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a build 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 buildTaskName The name of the container registry build task. + * @param buildTaskUpdateParameters The parameters for updating a build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildTaskInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName, BuildTaskUpdateParametersInner buildTaskUpdateParameters) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + if (buildTaskUpdateParameters == null) { + throw new IllegalArgumentException("Parameter buildTaskUpdateParameters is required and cannot be null."); + } + Validator.validate(buildTaskUpdateParameters); + final String apiVersion = "2018-02-01-preview"; + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, apiVersion, buildTaskUpdateParameters, 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); + } + + /** + * Get the source control properties for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @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 SourceRepositoryPropertiesInner object if successful. + */ + public SourceRepositoryPropertiesInner listSourceRepositoryProperties(String resourceGroupName, String registryName, String buildTaskName) { + return listSourceRepositoryPropertiesWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).toBlocking().single().body(); + } + + /** + * Get the source control properties for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build 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 listSourceRepositoryPropertiesAsync(String resourceGroupName, String registryName, String buildTaskName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listSourceRepositoryPropertiesWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName), serviceCallback); + } + + /** + * Get the source control properties for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SourceRepositoryPropertiesInner object + */ + public Observable listSourceRepositoryPropertiesAsync(String resourceGroupName, String registryName, String buildTaskName) { + return listSourceRepositoryPropertiesWithServiceResponseAsync(resourceGroupName, registryName, buildTaskName).map(new Func1, SourceRepositoryPropertiesInner>() { + @Override + public SourceRepositoryPropertiesInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Get the source control properties for a build task. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildTaskName The name of the container registry build task. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the SourceRepositoryPropertiesInner object + */ + public Observable> listSourceRepositoryPropertiesWithServiceResponseAsync(String resourceGroupName, String registryName, String buildTaskName) { + 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 (buildTaskName == null) { + throw new IllegalArgumentException("Parameter buildTaskName is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.listSourceRepositoryProperties(this.client.subscriptionId(), resourceGroupName, registryName, buildTaskName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listSourceRepositoryPropertiesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listSourceRepositoryPropertiesDelegate(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 all the build 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 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<BuildTaskInner> 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 build 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 build 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<BuildTaskInner> 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 build 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<BuildTaskInner> 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 build 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<BuildTaskInner> 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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildsInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildsInner.java new file mode 100644 index 00000000000..e650a2bb066 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/BuildsInner.java @@ -0,0 +1,1149 @@ +/** + * 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.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.BuildUpdateParameters; +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 Builds. + */ +public class BuildsInner { + /** The Retrofit service to perform REST calls. */ + private BuildsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of BuildsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public BuildsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(BuildsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Builds to be + * used by Retrofit to perform actually REST calls. + */ + interface BuildsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.Builds list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds") + 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, @Query("$skipToken") String skipToken, @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.Builds get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildId") String buildId, @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.Builds update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildId") String buildId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BuildUpdateParameters buildUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.Builds beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildId") String buildId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body BuildUpdateParameters buildUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.Builds getLogLink" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}/getLogLink") + Observable> getLogLink(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildId") String buildId, @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.Builds cancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}/cancel") + Observable> cancel(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildId") String buildId, @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.Builds beginCancel" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/builds/{buildId}/cancel") + Observable> beginCancel(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("buildId") String buildId, @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.Builds listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets all the builds 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 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<BuildInner> 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 builds 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 builds 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<BuildInner> 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 builds 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<BuildInner> 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 builds 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<BuildInner> 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 = "2018-02-01-preview"; + final String filter = null; + final Integer top = null; + final String skipToken = null; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, filter, top, skipToken, 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 builds 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 builds filter to apply on the operation. + * @param top $top is supported for get list of builds, which limits the maximum number of builds to return. + * @param skipToken $skipToken is supported on get list of builds, which provides the next page in the list of builds. + * @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<BuildInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName, final String filter, final Integer top, final String skipToken) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName, filter, top, skipToken).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Gets all the builds 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 builds filter to apply on the operation. + * @param top $top is supported for get list of builds, which limits the maximum number of builds to return. + * @param skipToken $skipToken is supported on get list of builds, which provides the next page in the list of builds. + * @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 String skipToken, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName, filter, top, skipToken), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Gets all the builds 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 builds filter to apply on the operation. + * @param top $top is supported for get list of builds, which limits the maximum number of builds to return. + * @param skipToken $skipToken is supported on get list of builds, which provides the next page in the list of builds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BuildInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top, final String skipToken) { + return listWithServiceResponseAsync(resourceGroupName, registryName, filter, top, skipToken) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Gets all the builds 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 builds filter to apply on the operation. + * @param top $top is supported for get list of builds, which limits the maximum number of builds to return. + * @param skipToken $skipToken is supported on get list of builds, which provides the next page in the list of builds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<BuildInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top, final String skipToken) { + return listSinglePageAsync(resourceGroupName, registryName, filter, top, skipToken) + .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 builds 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 builds filter to apply on the operation. + ServiceResponse> * @param top $top is supported for get list of builds, which limits the maximum number of builds to return. + ServiceResponse> * @param skipToken $skipToken is supported on get list of builds, which provides the next page in the list of builds. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<BuildInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName, final String filter, final Integer top, final String skipToken) { + 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 = "2018-02-01-preview"; + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, filter, top, skipToken, 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); + } + + /** + * Gets the detailed information for a given build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @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 BuildInner object if successful. + */ + public BuildInner get(String resourceGroupName, String registryName, String buildId) { + return getWithServiceResponseAsync(resourceGroupName, registryName, buildId).toBlocking().single().body(); + } + + /** + * Gets the detailed information for a given build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, buildId), serviceCallback); + } + + /** + * Gets the detailed information for a given build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String buildId) { + return getWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1, BuildInner>() { + @Override + public BuildInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the detailed information for a given build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String buildId) { + 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 (buildId == null) { + throw new IllegalArgumentException("Parameter buildId is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, buildId, 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); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @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 BuildInner object if successful. + */ + public BuildInner update(String resourceGroupName, String registryName, String buildId) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, buildId).toBlocking().last().body(); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, buildId), serviceCallback); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String buildId) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1, BuildInner>() { + @Override + public BuildInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildId) { + 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 (buildId == null) { + throw new IllegalArgumentException("Parameter buildId is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + final Boolean isArchiveEnabled = null; + BuildUpdateParameters buildUpdateParameters = new BuildUpdateParameters(); + buildUpdateParameters.withIsArchiveEnabled(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, buildId, apiVersion, this.client.acceptLanguage(), buildUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BuildInner object if successful. + */ + public BuildInner update(String resourceGroupName, String registryName, String buildId, Boolean isArchiveEnabled) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, buildId, isArchiveEnabled).toBlocking().last().body(); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, Boolean isArchiveEnabled, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, buildId, isArchiveEnabled), serviceCallback); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, Boolean isArchiveEnabled) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, buildId, isArchiveEnabled).map(new Func1, BuildInner>() { + @Override + public BuildInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, 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 (buildId == null) { + throw new IllegalArgumentException("Parameter buildId is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + BuildUpdateParameters buildUpdateParameters = new BuildUpdateParameters(); + buildUpdateParameters.withIsArchiveEnabled(isArchiveEnabled); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, buildId, apiVersion, this.client.acceptLanguage(), buildUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @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 BuildInner object if successful. + */ + public BuildInner beginUpdate(String resourceGroupName, String registryName, String buildId) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildId).toBlocking().single().body(); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildId), serviceCallback); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String buildId) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1, BuildInner>() { + @Override + public BuildInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildId) { + 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 (buildId == null) { + throw new IllegalArgumentException("Parameter buildId is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + final Boolean isArchiveEnabled = null; + BuildUpdateParameters buildUpdateParameters = new BuildUpdateParameters(); + buildUpdateParameters.withIsArchiveEnabled(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, buildId, apiVersion, this.client.acceptLanguage(), buildUpdateParameters, 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 build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @param isArchiveEnabled The value that indicates whether archiving is enabled or not. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the BuildInner object if successful. + */ + public BuildInner beginUpdate(String resourceGroupName, String registryName, String buildId, Boolean isArchiveEnabled) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildId, isArchiveEnabled).toBlocking().single().body(); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, Boolean isArchiveEnabled, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildId, isArchiveEnabled), serviceCallback); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 BuildInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String buildId, Boolean isArchiveEnabled) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, buildId, isArchiveEnabled).map(new Func1, BuildInner>() { + @Override + public BuildInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Patch the build properties. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 BuildInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String buildId, 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 (buildId == null) { + throw new IllegalArgumentException("Parameter buildId is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + BuildUpdateParameters buildUpdateParameters = new BuildUpdateParameters(); + buildUpdateParameters.withIsArchiveEnabled(isArchiveEnabled); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, buildId, apiVersion, this.client.acceptLanguage(), buildUpdateParameters, 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); + } + + /** + * Gets a link to download the build logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @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 BuildGetLogResultInner object if successful. + */ + public BuildGetLogResultInner getLogLink(String resourceGroupName, String registryName, String buildId) { + return getLogLinkWithServiceResponseAsync(resourceGroupName, registryName, buildId).toBlocking().single().body(); + } + + /** + * Gets a link to download the build logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 getLogLinkAsync(String resourceGroupName, String registryName, String buildId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getLogLinkWithServiceResponseAsync(resourceGroupName, registryName, buildId), serviceCallback); + } + + /** + * Gets a link to download the build logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildGetLogResultInner object + */ + public Observable getLogLinkAsync(String resourceGroupName, String registryName, String buildId) { + return getLogLinkWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1, BuildGetLogResultInner>() { + @Override + public BuildGetLogResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets a link to download the build logs. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildGetLogResultInner object + */ + public Observable> getLogLinkWithServiceResponseAsync(String resourceGroupName, String registryName, String buildId) { + 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 (buildId == null) { + throw new IllegalArgumentException("Parameter buildId is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.getLogLink(this.client.subscriptionId(), resourceGroupName, registryName, buildId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getLogLinkDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getLogLinkDelegate(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); + } + + /** + * Cancel an existing build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @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 cancel(String resourceGroupName, String registryName, String buildId) { + cancelWithServiceResponseAsync(resourceGroupName, registryName, buildId).toBlocking().last().body(); + } + + /** + * Cancel an existing build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(cancelWithServiceResponseAsync(resourceGroupName, registryName, buildId), serviceCallback); + } + + /** + * Cancel an existing build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable cancelAsync(String resourceGroupName, String registryName, String buildId) { + return cancelWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel an existing build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> cancelWithServiceResponseAsync(String resourceGroupName, String registryName, String buildId) { + 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 (buildId == null) { + throw new IllegalArgumentException("Parameter buildId is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + Observable> observable = service.cancel(this.client.subscriptionId(), resourceGroupName, registryName, buildId, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Cancel an existing build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @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 beginCancel(String resourceGroupName, String registryName, String buildId) { + beginCancelWithServiceResponseAsync(resourceGroupName, registryName, buildId).toBlocking().single().body(); + } + + /** + * Cancel an existing build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build 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 buildId, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCancelWithServiceResponseAsync(resourceGroupName, registryName, buildId), serviceCallback); + } + + /** + * Cancel an existing build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginCancelAsync(String resourceGroupName, String registryName, String buildId) { + return beginCancelWithServiceResponseAsync(resourceGroupName, registryName, buildId).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Cancel an existing build. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildId The build ID. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginCancelWithServiceResponseAsync(String resourceGroupName, String registryName, String buildId) { + 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 (buildId == null) { + throw new IllegalArgumentException("Parameter buildId is required and cannot be null."); + } + final String apiVersion = "2018-02-01-preview"; + return service.beginCancel(this.client.subscriptionId(), resourceGroupName, registryName, buildId, 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 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); + } + + /** + * Gets all the builds for a 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<BuildInner> 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 builds 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 builds 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<BuildInner> 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 builds 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<BuildInner> 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 builds 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<BuildInner> 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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ContainerRegistryManagementClientImpl.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ContainerRegistryManagementClientImpl.java index 8cda9a3be24..83b3f3a39b1 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ContainerRegistryManagementClientImpl.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ContainerRegistryManagementClientImpl.java @@ -51,18 +51,6 @@ public ContainerRegistryManagementClientImpl withSubscriptionId(String subscript return this; } - /** The client API version. */ - private String apiVersion; - - /** - * Gets The client API version. - * - * @return the apiVersion value. - */ - public String apiVersion() { - return this.apiVersion; - } - /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -184,6 +172,45 @@ public WebhooksInner webhooks() { return this.webhooks; } + /** + * The BuildsInner object to access its operations. + */ + private BuildsInner builds; + + /** + * Gets the BuildsInner object to access its operations. + * @return the BuildsInner object. + */ + public BuildsInner builds() { + return this.builds; + } + + /** + * The BuildStepsInner object to access its operations. + */ + private BuildStepsInner buildSteps; + + /** + * Gets the BuildStepsInner object to access its operations. + * @return the BuildStepsInner object. + */ + public BuildStepsInner buildSteps() { + return this.buildSteps; + } + + /** + * The BuildTasksInner object to access its operations. + */ + private BuildTasksInner buildTasks; + + /** + * Gets the BuildTasksInner object to access its operations. + * @return the BuildTasksInner object. + */ + public BuildTasksInner buildTasks() { + return this.buildTasks; + } + /** * Initializes an instance of ContainerRegistryManagementClient client. * @@ -215,7 +242,6 @@ public ContainerRegistryManagementClientImpl(RestClient restClient) { } protected void initialize() { - this.apiVersion = "2017-10-01"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -223,6 +249,9 @@ protected void initialize() { this.operations = new OperationsInner(restClient().retrofit(), this); this.replications = new ReplicationsInner(restClient().retrofit(), this); this.webhooks = new WebhooksInner(restClient().retrofit(), this); + this.builds = new BuildsInner(restClient().retrofit(), this); + this.buildSteps = new BuildStepsInner(restClient().retrofit(), this); + this.buildTasks = new BuildTasksInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -233,6 +262,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2017-10-01"); + return String.format("%s (%s)", super.userAgent(), "ContainerRegistryManagementClient"); } } diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/OperationsInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/OperationsInner.java index 7e6b72db7e2..598174e16f5 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/OperationsInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/OperationsInner.java @@ -145,10 +145,8 @@ public Observable>> call(ServiceR * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -162,7 +160,7 @@ public Observable>> call(Response }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + 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) diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/QueueBuildRequestInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/QueueBuildRequestInner.java new file mode 100644 index 00000000000..759be1b7398 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/QueueBuildRequestInner.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.implementation; + +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The queue build request parameters. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("QueueBuildRequest") +@JsonSubTypes({ + @JsonSubTypes.Type(name = "BuildTask", value = BuildTaskBuildRequest.class), + @JsonSubTypes.Type(name = "QuickBuild", value = QuickBuildRequest.class) +}) +public class QueueBuildRequestInner { +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java index 53e25f6b7a4..60e87881932 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java @@ -121,6 +121,18 @@ interface RegistriesService { @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.Registries queueBuild" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/queueBuild") + Observable> queueBuild(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body QueueBuildRequestInner buildRequest, @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.Registries beginQueueBuild" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/queueBuild") + Observable> beginQueueBuild(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body QueueBuildRequestInner buildRequest, @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.Registries getBuildSourceUploadUrl" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/getBuildSourceUploadUrl") + 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.Registries listByResourceGroupNext" }) @GET Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -183,15 +195,13 @@ public Observable> checkNameAvailabilit if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + final String apiVersion = "2017-10-01"; RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); registryNameCheckRequest.withName(name); - return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), registryNameCheckRequest, this.client.userAgent()) + return service.checkNameAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), registryNameCheckRequest, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -274,10 +284,8 @@ public Observable> getByResourceGroupWithServiceR if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -364,14 +372,12 @@ public Observable> createWithServiceResponseAsync if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (registry == null) { throw new IllegalArgumentException("Parameter registry is required and cannot be null."); } Validator.validate(registry); - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registry, this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01"; + 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()); } @@ -441,14 +447,12 @@ public Observable> beginCreateWithServiceResponse if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (registry == null) { throw new IllegalArgumentException("Parameter registry is required and cannot be null."); } Validator.validate(registry); - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registry, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -531,10 +535,8 @@ public Observable> deleteWithServiceResponseAsync(String r if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01"; + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -599,10 +601,8 @@ public Observable> beginDeleteWithServiceResponseAsync(Str if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -691,14 +691,12 @@ public Observable> updateWithServiceResponseAsync if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (registryUpdateParameters == null) { throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); } Validator.validate(registryUpdateParameters); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01"; + 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()); } @@ -768,14 +766,12 @@ public Observable> beginUpdateWithServiceResponse if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (registryUpdateParameters == null) { throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); } Validator.validate(registryUpdateParameters); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -888,10 +884,8 @@ public Observable>> listByResourceGroupSingl if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -995,10 +989,8 @@ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1081,10 +1073,8 @@ public Observable> listCrede if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listCredentials(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -1171,15 +1161,13 @@ public Observable> regenerat if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } + final String apiVersion = "2017-10-01"; RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters(); regenerateCredentialParameters.withName(name); - return service.regenerateCredential(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateCredentialParameters, this.client.userAgent()) + 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) { @@ -1262,10 +1250,8 @@ public Observable> listUsagesWithS if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listUsages(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -1286,6 +1272,258 @@ private ServiceResponse listUsagesDelegate(Respons .build(response); } + /** + * Creates a new build based on the request parameters and add it to the build queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildRequest The parameters of a build that needs to queued. + * @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 BuildInner object if successful. + */ + public BuildInner queueBuild(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { + return queueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).toBlocking().last().body(); + } + + /** + * Creates a new build based on the request parameters and add it to the build queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildRequest The parameters of a build that needs to queued. + * @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 queueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(queueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest), serviceCallback); + } + + /** + * Creates a new build based on the request parameters and add it to the build queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildRequest The parameters of a build that needs to queued. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable queueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { + return queueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).map(new Func1, BuildInner>() { + @Override + public BuildInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new build based on the request parameters and add it to the build queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildRequest The parameters of a build that needs to queued. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> queueBuildWithServiceResponseAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { + 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 (buildRequest == null) { + throw new IllegalArgumentException("Parameter buildRequest is required and cannot be null."); + } + Validator.validate(buildRequest); + final String apiVersion = "2018-02-01-preview"; + Observable> observable = service.queueBuild(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, buildRequest, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a new build based on the request parameters and add it to the build queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildRequest The parameters of a build that needs to queued. + * @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 BuildInner object if successful. + */ + public BuildInner beginQueueBuild(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { + return beginQueueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).toBlocking().single().body(); + } + + /** + * Creates a new build based on the request parameters and add it to the build queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildRequest The parameters of a build that needs to queued. + * @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 beginQueueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginQueueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest), serviceCallback); + } + + /** + * Creates a new build based on the request parameters and add it to the build queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildRequest The parameters of a build that needs to queued. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildInner object + */ + public Observable beginQueueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { + return beginQueueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).map(new Func1, BuildInner>() { + @Override + public BuildInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a new build based on the request parameters and add it to the build queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param buildRequest The parameters of a build that needs to queued. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the BuildInner object + */ + public Observable> beginQueueBuildWithServiceResponseAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { + 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 (buildRequest == null) { + throw new IllegalArgumentException("Parameter buildRequest is required and cannot be null."); + } + Validator.validate(buildRequest); + final String apiVersion = "2018-02-01-preview"; + return service.beginQueueBuild(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, buildRequest, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginQueueBuildDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginQueueBuildDelegate(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); + } + + /** + * 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 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 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 = "2018-02-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 CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + /** * Lists all the container registries under the specified resource group. * diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ReplicationsInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ReplicationsInner.java index 49aa2594b99..bfa6a02222f 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ReplicationsInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ReplicationsInner.java @@ -171,10 +171,8 @@ public Observable> getWithServiceResponseAsync if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -268,14 +266,12 @@ public Observable> createWithServiceResponseAs if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (replication == null) { throw new IllegalArgumentException("Parameter replication is required and cannot be null."); } Validator.validate(replication); - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), replication, this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01"; + 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()); } @@ -352,14 +348,12 @@ public Observable> beginCreateWithServiceRespo if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (replication == null) { throw new IllegalArgumentException("Parameter replication is required and cannot be null."); } Validator.validate(replication); - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), replication, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -449,10 +443,8 @@ public Observable> deleteWithServiceResponseAsync(String r if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01"; + 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()); } @@ -524,10 +516,8 @@ public Observable> beginDeleteWithServiceResponseAsync(Str if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -619,13 +609,11 @@ public Observable> updateWithServiceResponseAs if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } + final String apiVersion = "2017-10-01"; final Map tags = null; ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); replicationUpdateParameters.withTags(null); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + 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()); } /** @@ -701,13 +689,11 @@ public Observable> updateWithServiceResponseAs if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } Validator.validate(tags); + final String apiVersion = "2017-10-01"; ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); replicationUpdateParameters.withTags(tags); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + 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()); } @@ -780,13 +766,11 @@ public Observable> beginUpdateWithServiceRespo if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } + final String apiVersion = "2017-10-01"; final Map tags = null; ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); replicationUpdateParameters.withTags(null); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) + 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) { @@ -873,13 +857,11 @@ public Observable> beginUpdateWithServiceRespo if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } Validator.validate(tags); + final String apiVersion = "2017-10-01"; ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); replicationUpdateParameters.withTags(tags); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) + 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) { @@ -1000,10 +982,8 @@ public Observable>> listSinglePageAsync(f if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/SourceRepositoryPropertiesInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/SourceRepositoryPropertiesInner.java new file mode 100644 index 00000000000..5ddf3cc2d53 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/SourceRepositoryPropertiesInner.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.implementation; + +import com.microsoft.azure.management.containerregistry.SourceControlType; +import com.microsoft.azure.management.containerregistry.SourceControlAuthInfo; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of the source code repository. + */ +public class SourceRepositoryPropertiesInner { + /** + * 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 respository. + */ + @JsonProperty(value = "repositoryUrl", required = true) + private String repositoryUrl; + + /** + * The value of this property indicates whether the source control commit + * trigger is enabled or not. + */ + @JsonProperty(value = "isCommitTriggerEnabled") + private Boolean isCommitTriggerEnabled; + + /** + * The authorization properties for accessing the source code repository. + */ + @JsonProperty(value = "sourceControlAuthProperties") + private SourceControlAuthInfo sourceControlAuthProperties; + + /** + * Get the sourceControlType value. + * + * @return the sourceControlType value + */ + public SourceControlType sourceControlType() { + return this.sourceControlType; + } + + /** + * Set the sourceControlType value. + * + * @param sourceControlType the sourceControlType value to set + * @return the SourceRepositoryPropertiesInner object itself. + */ + public SourceRepositoryPropertiesInner withSourceControlType(SourceControlType sourceControlType) { + this.sourceControlType = sourceControlType; + return this; + } + + /** + * Get the repositoryUrl value. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repositoryUrl value. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceRepositoryPropertiesInner object itself. + */ + public SourceRepositoryPropertiesInner withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the isCommitTriggerEnabled value. + * + * @return the isCommitTriggerEnabled value + */ + public Boolean isCommitTriggerEnabled() { + return this.isCommitTriggerEnabled; + } + + /** + * Set the isCommitTriggerEnabled value. + * + * @param isCommitTriggerEnabled the isCommitTriggerEnabled value to set + * @return the SourceRepositoryPropertiesInner object itself. + */ + public SourceRepositoryPropertiesInner withIsCommitTriggerEnabled(Boolean isCommitTriggerEnabled) { + this.isCommitTriggerEnabled = isCommitTriggerEnabled; + return this; + } + + /** + * Get the sourceControlAuthProperties value. + * + * @return the sourceControlAuthProperties value + */ + public SourceControlAuthInfo sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the sourceControlAuthProperties value. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set + * @return the SourceRepositoryPropertiesInner object itself. + */ + public SourceRepositoryPropertiesInner withSourceControlAuthProperties(SourceControlAuthInfo sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/SourceUploadDefinitionInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/SourceUploadDefinitionInner.java new file mode 100644 index 00000000000..77c55a32e76 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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.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 uploadUrl value. + * + * @return the uploadUrl value + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set the uploadUrl value. + * + * @param uploadUrl the uploadUrl value to set + * @return the SourceUploadDefinitionInner object itself. + */ + public SourceUploadDefinitionInner withUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + * Get the relativePath value. + * + * @return the relativePath value + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relativePath value. + * + * @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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java index c7b23fd8161..772444c80e5 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java @@ -186,10 +186,8 @@ public Observable> getWithServiceResponseAsync(Str if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.get(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -283,14 +281,12 @@ public Observable> createWithServiceResponseAsync( if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (webhookCreateParameters == null) { throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); } Validator.validate(webhookCreateParameters); - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01"; + 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()); } @@ -367,14 +363,12 @@ public Observable> beginCreateWithServiceResponseA if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (webhookCreateParameters == null) { throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); } Validator.validate(webhookCreateParameters); - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -464,10 +458,8 @@ public Observable> deleteWithServiceResponseAsync(String r if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01"; + 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()); } @@ -539,10 +531,8 @@ public Observable> beginDeleteWithServiceResponseAsync(Str if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -638,14 +628,12 @@ public Observable> updateWithServiceResponseAsync( if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (webhookUpdateParameters == null) { throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); } Validator.validate(webhookUpdateParameters); - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + final String apiVersion = "2017-10-01"; + 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()); } @@ -722,14 +710,12 @@ public Observable> beginUpdateWithServiceResponseA if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } if (webhookUpdateParameters == null) { throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); } Validator.validate(webhookUpdateParameters); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -850,10 +836,8 @@ public Observable>> listSinglePageAsync(final if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -943,10 +927,8 @@ public Observable> pingWithServiceResponseAsync( if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.ping(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -1036,10 +1018,8 @@ public Observable> getCallbackConfigWithSer if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.getCallbackConfig(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { @@ -1167,10 +1147,8 @@ public Observable>> listEventsSinglePageAsync(f if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - if (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - return service.listEvents(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + final String apiVersion = "2017-10-01"; + 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) { From 98285cfc78194d7a94541efbd7fedccbbabe855b Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 20 Apr 2018 21:28:53 +0000 Subject: [PATCH 3/5] Generated from 5fa239f0f0abdd6dbba20252958288384b5fe797 Fix Error status, fix version (#5) * Remove error schema * Add default response back * Fix abandoned as system error * Fix Error status * Use preview tag * Fix tag * Remove error response schema as they are not used --- ...ContainerRegistryManagementClientImpl.java | 57 +-- .../implementation/OperationsInner.java | 8 +- .../implementation/RegistriesInner.java | 342 +++--------------- .../implementation/ReplicationsInner.java | 60 ++- .../implementation/WebhooksInner.java | 66 ++-- 5 files changed, 155 insertions(+), 378 deletions(-) diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ContainerRegistryManagementClientImpl.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ContainerRegistryManagementClientImpl.java index 83b3f3a39b1..8cda9a3be24 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ContainerRegistryManagementClientImpl.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ContainerRegistryManagementClientImpl.java @@ -51,6 +51,18 @@ public ContainerRegistryManagementClientImpl withSubscriptionId(String subscript return this; } + /** The client API version. */ + private String apiVersion; + + /** + * Gets The client API version. + * + * @return the apiVersion value. + */ + public String apiVersion() { + return this.apiVersion; + } + /** Gets or sets the preferred language for the response. */ private String acceptLanguage; @@ -172,45 +184,6 @@ public WebhooksInner webhooks() { return this.webhooks; } - /** - * The BuildsInner object to access its operations. - */ - private BuildsInner builds; - - /** - * Gets the BuildsInner object to access its operations. - * @return the BuildsInner object. - */ - public BuildsInner builds() { - return this.builds; - } - - /** - * The BuildStepsInner object to access its operations. - */ - private BuildStepsInner buildSteps; - - /** - * Gets the BuildStepsInner object to access its operations. - * @return the BuildStepsInner object. - */ - public BuildStepsInner buildSteps() { - return this.buildSteps; - } - - /** - * The BuildTasksInner object to access its operations. - */ - private BuildTasksInner buildTasks; - - /** - * Gets the BuildTasksInner object to access its operations. - * @return the BuildTasksInner object. - */ - public BuildTasksInner buildTasks() { - return this.buildTasks; - } - /** * Initializes an instance of ContainerRegistryManagementClient client. * @@ -242,6 +215,7 @@ public ContainerRegistryManagementClientImpl(RestClient restClient) { } protected void initialize() { + this.apiVersion = "2017-10-01"; this.acceptLanguage = "en-US"; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -249,9 +223,6 @@ protected void initialize() { this.operations = new OperationsInner(restClient().retrofit(), this); this.replications = new ReplicationsInner(restClient().retrofit(), this); this.webhooks = new WebhooksInner(restClient().retrofit(), this); - this.builds = new BuildsInner(restClient().retrofit(), this); - this.buildSteps = new BuildStepsInner(restClient().retrofit(), this); - this.buildTasks = new BuildTasksInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } @@ -262,6 +233,6 @@ protected void initialize() { */ @Override public String userAgent() { - return String.format("%s (%s)", super.userAgent(), "ContainerRegistryManagementClient"); + return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2017-10-01"); } } diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/OperationsInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/OperationsInner.java index 598174e16f5..7e6b72db7e2 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/OperationsInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/OperationsInner.java @@ -145,8 +145,10 @@ public Observable>> call(ServiceR * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. */ public Observable>> listSinglePageAsync() { - final String apiVersion = "2017-10-01"; - return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -160,7 +162,7 @@ public Observable>> call(Response }); } - private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + 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) diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java index 60e87881932..53e25f6b7a4 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java @@ -121,18 +121,6 @@ interface RegistriesService { @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.Registries queueBuild" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/queueBuild") - Observable> queueBuild(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body QueueBuildRequestInner buildRequest, @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.Registries beginQueueBuild" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/queueBuild") - Observable> beginQueueBuild(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body QueueBuildRequestInner buildRequest, @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.Registries getBuildSourceUploadUrl" }) - @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/getBuildSourceUploadUrl") - 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.Registries listByResourceGroupNext" }) @GET Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); @@ -195,13 +183,15 @@ public Observable> checkNameAvailabilit if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - final String apiVersion = "2017-10-01"; RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); registryNameCheckRequest.withName(name); - return service.checkNameAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), registryNameCheckRequest, this.client.userAgent()) + return service.checkNameAvailability(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), registryNameCheckRequest, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -284,8 +274,10 @@ public Observable> getByResourceGroupWithServiceR if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -372,12 +364,14 @@ public Observable> createWithServiceResponseAsync if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (registry == null) { throw new IllegalArgumentException("Parameter registry is required and cannot be null."); } Validator.validate(registry); - final String apiVersion = "2017-10-01"; - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registry, this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registry, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -447,12 +441,14 @@ public Observable> beginCreateWithServiceResponse if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (registry == null) { throw new IllegalArgumentException("Parameter registry is required and cannot be null."); } Validator.validate(registry); - final String apiVersion = "2017-10-01"; - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registry, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registry, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -535,8 +531,10 @@ public Observable> deleteWithServiceResponseAsync(String r if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -601,8 +599,10 @@ public Observable> beginDeleteWithServiceResponseAsync(Str if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -691,12 +691,14 @@ public Observable> updateWithServiceResponseAsync if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (registryUpdateParameters == null) { throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); } Validator.validate(registryUpdateParameters); - final String apiVersion = "2017-10-01"; - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -766,12 +768,14 @@ public Observable> beginUpdateWithServiceResponse if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (registryUpdateParameters == null) { throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); } Validator.validate(registryUpdateParameters); - final String apiVersion = "2017-10-01"; - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registryUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -884,8 +888,10 @@ public Observable>> listByResourceGroupSingl if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -989,8 +995,10 @@ public Observable>> listSinglePageAsync() { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -1073,8 +1081,10 @@ public Observable> listCrede if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.listCredentials(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listCredentials(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1161,13 +1171,15 @@ public Observable> regenerat if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (name == null) { throw new IllegalArgumentException("Parameter name is required and cannot be null."); } - final String apiVersion = "2017-10-01"; RegenerateCredentialParameters regenerateCredentialParameters = new RegenerateCredentialParameters(); regenerateCredentialParameters.withName(name); - return service.regenerateCredential(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), regenerateCredentialParameters, this.client.userAgent()) + return service.regenerateCredential(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), regenerateCredentialParameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1250,8 +1262,10 @@ public Observable> listUsagesWithS if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.listUsages(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listUsages(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1272,258 +1286,6 @@ private ServiceResponse listUsagesDelegate(Respons .build(response); } - /** - * Creates a new build based on the request parameters and add it to the build queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param buildRequest The parameters of a build that needs to queued. - * @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 BuildInner object if successful. - */ - public BuildInner queueBuild(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { - return queueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).toBlocking().last().body(); - } - - /** - * Creates a new build based on the request parameters and add it to the build queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param buildRequest The parameters of a build that needs to queued. - * @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 queueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(queueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest), serviceCallback); - } - - /** - * Creates a new build based on the request parameters and add it to the build queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param buildRequest The parameters of a build that needs to queued. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable queueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { - return queueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).map(new Func1, BuildInner>() { - @Override - public BuildInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Creates a new build based on the request parameters and add it to the build queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param buildRequest The parameters of a build that needs to queued. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable for the request - */ - public Observable> queueBuildWithServiceResponseAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { - 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 (buildRequest == null) { - throw new IllegalArgumentException("Parameter buildRequest is required and cannot be null."); - } - Validator.validate(buildRequest); - final String apiVersion = "2018-02-01-preview"; - Observable> observable = service.queueBuild(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, buildRequest, this.client.acceptLanguage(), this.client.userAgent()); - return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); - } - - /** - * Creates a new build based on the request parameters and add it to the build queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param buildRequest The parameters of a build that needs to queued. - * @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 BuildInner object if successful. - */ - public BuildInner beginQueueBuild(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { - return beginQueueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).toBlocking().single().body(); - } - - /** - * Creates a new build based on the request parameters and add it to the build queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param buildRequest The parameters of a build that needs to queued. - * @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 beginQueueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest, final ServiceCallback serviceCallback) { - return ServiceFuture.fromResponse(beginQueueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest), serviceCallback); - } - - /** - * Creates a new build based on the request parameters and add it to the build queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param buildRequest The parameters of a build that needs to queued. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the BuildInner object - */ - public Observable beginQueueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { - return beginQueueBuildWithServiceResponseAsync(resourceGroupName, registryName, buildRequest).map(new Func1, BuildInner>() { - @Override - public BuildInner call(ServiceResponse response) { - return response.body(); - } - }); - } - - /** - * Creates a new build based on the request parameters and add it to the build queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param buildRequest The parameters of a build that needs to queued. - * @throws IllegalArgumentException thrown if parameters fail the validation - * @return the observable to the BuildInner object - */ - public Observable> beginQueueBuildWithServiceResponseAsync(String resourceGroupName, String registryName, QueueBuildRequestInner buildRequest) { - 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 (buildRequest == null) { - throw new IllegalArgumentException("Parameter buildRequest is required and cannot be null."); - } - Validator.validate(buildRequest); - final String apiVersion = "2018-02-01-preview"; - return service.beginQueueBuild(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, buildRequest, this.client.acceptLanguage(), this.client.userAgent()) - .flatMap(new Func1, Observable>>() { - @Override - public Observable> call(Response response) { - try { - ServiceResponse clientResponse = beginQueueBuildDelegate(response); - return Observable.just(clientResponse); - } catch (Throwable t) { - return Observable.error(t); - } - } - }); - } - - private ServiceResponse beginQueueBuildDelegate(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); - } - - /** - * 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 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 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 = "2018-02-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 CloudException, IOException, IllegalArgumentException { - return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) - .register(200, new TypeToken() { }.getType()) - .registerError(CloudException.class) - .build(response); - } - /** * Lists all the container registries under the specified resource group. * diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ReplicationsInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ReplicationsInner.java index bfa6a02222f..49aa2594b99 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ReplicationsInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ReplicationsInner.java @@ -171,8 +171,10 @@ public Observable> getWithServiceResponseAsync if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.get(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -266,12 +268,14 @@ public Observable> createWithServiceResponseAs if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (replication == null) { throw new IllegalArgumentException("Parameter replication is required and cannot be null."); } Validator.validate(replication); - final String apiVersion = "2017-10-01"; - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, replication, this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), replication, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -348,12 +352,14 @@ public Observable> beginCreateWithServiceRespo if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (replication == null) { throw new IllegalArgumentException("Parameter replication is required and cannot be null."); } Validator.validate(replication); - final String apiVersion = "2017-10-01"; - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, replication, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), replication, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -443,8 +449,10 @@ public Observable> deleteWithServiceResponseAsync(String r if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -516,8 +524,10 @@ public Observable> beginDeleteWithServiceResponseAsync(Str if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -609,11 +619,13 @@ public Observable> updateWithServiceResponseAs if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } 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()); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } /** @@ -689,11 +701,13 @@ public Observable> updateWithServiceResponseAs if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } Validator.validate(tags); - final String apiVersion = "2017-10-01"; 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()); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -766,11 +780,13 @@ public Observable> beginUpdateWithServiceRespo if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } 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()) + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -857,11 +873,13 @@ public Observable> beginUpdateWithServiceRespo if (replicationName == null) { throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } Validator.validate(tags); - final String apiVersion = "2017-10-01"; ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); replicationUpdateParameters.withTags(tags); - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -982,8 +1000,10 @@ public Observable>> listSinglePageAsync(f if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java index 772444c80e5..c7b23fd8161 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/WebhooksInner.java @@ -186,8 +186,10 @@ public Observable> getWithServiceResponseAsync(Str if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.get(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.get(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -281,12 +283,14 @@ public Observable> createWithServiceResponseAsync( if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (webhookCreateParameters == null) { throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); } Validator.validate(webhookCreateParameters); - final String apiVersion = "2017-10-01"; - Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -363,12 +367,14 @@ public Observable> beginCreateWithServiceResponseA if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (webhookCreateParameters == null) { throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); } Validator.validate(webhookCreateParameters); - final String apiVersion = "2017-10-01"; - return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), webhookCreateParameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -458,8 +464,10 @@ public Observable> deleteWithServiceResponseAsync(String r if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()); + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Observable> observable = service.delete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); } @@ -531,8 +539,10 @@ public Observable> beginDeleteWithServiceResponseAsync(Str if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.beginDelete(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -628,12 +638,14 @@ public Observable> updateWithServiceResponseAsync( if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (webhookUpdateParameters == null) { throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); } Validator.validate(webhookUpdateParameters); - final String apiVersion = "2017-10-01"; - Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); } @@ -710,12 +722,14 @@ public Observable> beginUpdateWithServiceResponseA if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } if (webhookUpdateParameters == null) { throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); } Validator.validate(webhookUpdateParameters); - final String apiVersion = "2017-10-01"; - return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), webhookUpdateParameters, this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -836,8 +850,10 @@ public Observable>> listSinglePageAsync(final if (registryName == null) { throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.list(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { @@ -927,8 +943,10 @@ public Observable> pingWithServiceResponseAsync( if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.ping(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.ping(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1018,8 +1036,10 @@ public Observable> getCallbackConfigWithSer if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.getCallbackConfig(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getCallbackConfig(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>() { @Override public Observable> call(Response response) { @@ -1147,8 +1167,10 @@ public Observable>> listEventsSinglePageAsync(f if (webhookName == null) { throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); } - final String apiVersion = "2017-10-01"; - return service.listEvents(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.listEvents(this.client.subscriptionId(), resourceGroupName, registryName, webhookName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1, Observable>>>() { @Override public Observable>> call(Response response) { From f9cd0cbe9d617b065fac1bfa17832a645c5e8582 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 24 Apr 2018 02:50:34 +0000 Subject: [PATCH 4/5] Generated from 074adc160df8cd2dbe1c3295c478f7092ba09207 Fix CI (#7) * Add python sdk version * Add preview to namespace * Remove an example --- .../containerregistry/ImportMode.java | 41 ++++ .../containerregistry/ImportSource.java | 74 ++++++++ .../ImportImageParametersInner.java | 128 +++++++++++++ .../implementation/RegistriesInner.java | 178 ++++++++++++++++++ 4 files changed, 421 insertions(+) create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImportMode.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImportSource.java create mode 100644 azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ImportImageParametersInner.java diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImportMode.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImportMode.java new file mode 100644 index 00000000000..b1bdfcde0b8 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/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; + +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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImportSource.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImportSource.java new file mode 100644 index 00000000000..b17767c2fe7 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/ImportSource.java @@ -0,0 +1,74 @@ +/** + * 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; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportSource model. + */ +public class ImportSource { + /** + * The resource identifier of the target Azure Container Registry. + */ + @JsonProperty(value = "resourceId", required = true) + private String resourceId; + + /** + * 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 resourceId value. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resourceId value. + * + * @param resourceId the resourceId value to set + * @return the ImportSource object itself. + */ + public ImportSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get the sourceImage value. + * + * @return the sourceImage value + */ + public String sourceImage() { + return this.sourceImage; + } + + /** + * Set the sourceImage value. + * + * @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/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ImportImageParametersInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ImportImageParametersInner.java new file mode 100644 index 00000000000..d89ccf65201 --- /dev/null +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/ImportImageParametersInner.java @@ -0,0 +1,128 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.containerregistry.ImportSource; +import java.util.List; +import com.microsoft.azure.management.containerregistry.ImportMode; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportImageParametersInner model. + */ +public class ImportImageParametersInner { + /** + * 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 value. + * + * @return the source value + */ + public ImportSource source() { + return this.source; + } + + /** + * Set the source value. + * + * @param source the source value to set + * @return the ImportImageParametersInner object itself. + */ + public ImportImageParametersInner withSource(ImportSource source) { + this.source = source; + return this; + } + + /** + * Get the targetTags value. + * + * @return the targetTags value + */ + public List targetTags() { + return this.targetTags; + } + + /** + * Set the targetTags value. + * + * @param targetTags the targetTags value to set + * @return the ImportImageParametersInner object itself. + */ + public ImportImageParametersInner withTargetTags(List targetTags) { + this.targetTags = targetTags; + return this; + } + + /** + * Get the untaggedTargetRepositories value. + * + * @return the untaggedTargetRepositories value + */ + public List untaggedTargetRepositories() { + return this.untaggedTargetRepositories; + } + + /** + * Set the untaggedTargetRepositories value. + * + * @param untaggedTargetRepositories the untaggedTargetRepositories value to set + * @return the ImportImageParametersInner object itself. + */ + public ImportImageParametersInner withUntaggedTargetRepositories(List untaggedTargetRepositories) { + this.untaggedTargetRepositories = untaggedTargetRepositories; + return this; + } + + /** + * Get the mode value. + * + * @return the mode value + */ + public ImportMode mode() { + return this.mode; + } + + /** + * Set the mode value. + * + * @param mode the mode value to set + * @return the ImportImageParametersInner object itself. + */ + public ImportImageParametersInner withMode(ImportMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java index 53e25f6b7a4..299d1e5423c 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java @@ -69,6 +69,14 @@ public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl * 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.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 ImportImageParametersInner 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.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 ImportImageParametersInner 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.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); @@ -131,6 +139,176 @@ interface RegistriesService { } + /** + * 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, ImportImageParametersInner 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, ImportImageParametersInner 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, ImportImageParametersInner 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, ImportImageParametersInner 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + Observable> observable = service.importImage(this.client.subscriptionId(), resourceGroupName, registryName, this.client.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, ImportImageParametersInner 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, ImportImageParametersInner 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, ImportImageParametersInner 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, ImportImageParametersInner 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 (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + return service.beginImportImage(this.client.subscriptionId(), resourceGroupName, registryName, this.client.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. * From 7b9803d4a6c00b8f1836ced141b7b4d98cefcf91 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 24 Apr 2018 20:31:30 +0000 Subject: [PATCH 5/5] Generated from 5e072f9f70cfd1ff9a8eb343e4d3d42e7c338a8a Fix examples (#8) --- .../implementation/RegistriesInner.java | 178 ------------------ 1 file changed, 178 deletions(-) diff --git a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java index 299d1e5423c..53e25f6b7a4 100644 --- a/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java +++ b/azure-mgmt-containerregistry/src/main/java/com/microsoft/azure/management/containerregistry/implementation/RegistriesInner.java @@ -69,14 +69,6 @@ public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl * 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.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 ImportImageParametersInner 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.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 ImportImageParametersInner 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.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); @@ -139,176 +131,6 @@ interface RegistriesService { } - /** - * 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, ImportImageParametersInner 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, ImportImageParametersInner 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, ImportImageParametersInner 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, ImportImageParametersInner 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 (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - Observable> observable = service.importImage(this.client.subscriptionId(), resourceGroupName, registryName, this.client.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, ImportImageParametersInner 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, ImportImageParametersInner 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, ImportImageParametersInner 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, ImportImageParametersInner 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 (this.client.apiVersion() == null) { - throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); - } - if (parameters == null) { - throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); - } - Validator.validate(parameters); - return service.beginImportImage(this.client.subscriptionId(), resourceGroupName, registryName, this.client.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. *