From f8963beebee4cdfb9bfcd07a80805120c544a649 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 26 Jun 2018 13:39:52 -0700 Subject: [PATCH] Generated from 16f9e23c3d97f360447f72c29d68cb71885197bb (#2143) minor --- .../v2016_06_27_preview/pom.xml | 133 ++ .../v2016_06_27_preview/Registries.java | 54 + .../v2016_06_27_preview/Registry.java | 129 ++ .../RegistryCredentials.java | 30 + .../RegistryNameCheckRequest.java | 78 + .../RegistryNameStatus.java | 35 + .../RegistryUpdateParameters.java | 101 + .../StorageAccountProperties.java | 69 + ...ContainerRegistryManagementClientImpl.java | 196 ++ .../ContainerRegistryManager.java | 99 + .../implementation/IdParsingUtils.java | 57 + .../implementation/PageImpl.java | 75 + .../implementation/RegistriesImpl.java | 176 ++ .../implementation/RegistriesInner.java | 1175 ++++++++++ .../RegistryCredentialsImpl.java | 36 + .../RegistryCredentialsInner.java | 70 + .../implementation/RegistryImpl.java | 109 + .../implementation/RegistryInner.java | 107 + .../RegistryNameStatusImpl.java | 41 + .../RegistryNameStatusInner.java | 97 + .../implementation/package-info.java | 10 + .../v2016_06_27_preview/package-info.java | 10 + .../resource-manager/v2017_03_01/pom.xml | 133 ++ .../v2017_03_01/OperationDefinition.java | 30 + .../OperationDisplayDefinition.java | 121 ++ .../v2017_03_01/Operations.java | 27 + .../v2017_03_01/PasswordName.java | 53 + .../v2017_03_01/ProvisioningState.java | 53 + .../RegenerateCredentialParameters.java | 44 + .../v2017_03_01/Registries.java | 55 + .../v2017_03_01/Registry.java | 149 ++ .../v2017_03_01/RegistryCreateParameters.java | 153 ++ .../RegistryListCredentialsResult.java | 31 + .../v2017_03_01/RegistryNameCheckRequest.java | 78 + .../v2017_03_01/RegistryNameStatus.java | 35 + .../v2017_03_01/RegistryPassword.java | 69 + .../v2017_03_01/RegistryUpdateParameters.java | 100 + .../containerregistry/v2017_03_01/Sku.java | 59 + .../v2017_03_01/SkuTier.java | 38 + .../v2017_03_01/StorageAccountParameters.java | 69 + .../v2017_03_01/StorageAccountProperties.java | 43 + ...ContainerRegistryManagementClientImpl.java | 210 ++ .../ContainerRegistryManager.java | 111 + .../implementation/IdParsingUtils.java | 57 + .../OperationDefinitionImpl.java | 37 + .../OperationDefinitionInner.java | 70 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 +++ .../v2017_03_01/implementation/PageImpl.java | 75 + .../implementation/RegistriesImpl.java | 177 ++ .../implementation/RegistriesInner.java | 1268 +++++++++++ .../implementation/RegistryImpl.java | 134 ++ .../implementation/RegistryInner.java | 148 ++ .../RegistryListCredentialsResultImpl.java | 38 + .../RegistryListCredentialsResultInner.java | 71 + .../RegistryNameStatusImpl.java | 41 + .../RegistryNameStatusInner.java | 97 + .../implementation/package-info.java | 10 + .../v2017_03_01/package-info.java | 10 + .../v2017_06_01_preview/pom.xml | 133 ++ .../v2017_06_01_preview/Actor.java | 45 + .../v2017_06_01_preview/CallbackConfig.java | 31 + .../v2017_06_01_preview/Event.java | 35 + .../v2017_06_01_preview/EventContent.java | 202 ++ .../v2017_06_01_preview/EventInfo.java | 25 + .../EventRequestMessage.java | 148 ++ .../EventResponseMessage.java | 148 ++ .../OperationDefinition.java | 30 + .../OperationDisplayDefinition.java | 121 ++ .../v2017_06_01_preview/Operations.java | 27 + .../v2017_06_01_preview/PasswordName.java | 53 + .../ProvisioningState.java | 53 + .../RegenerateCredentialParameters.java | 44 + .../v2017_06_01_preview/Registries.java | 65 + .../v2017_06_01_preview/Registry.java | 164 ++ .../RegistryListCredentialsResult.java | 31 + .../RegistryNameCheckRequest.java | 78 + .../RegistryNameStatus.java | 35 + .../v2017_06_01_preview/RegistryPassword.java | 69 + .../RegistryUpdateParameters.java | 126 ++ .../v2017_06_01_preview/RegistryUsage.java | 121 ++ .../RegistryUsageListResult.java | 26 + .../RegistryUsageUnit.java | 41 + .../v2017_06_01_preview/Replication.java | 136 ++ .../ReplicationUpdateParameters.java | 44 + .../v2017_06_01_preview/Replications.java | 53 + .../v2017_06_01_preview/Request.java | 150 ++ .../v2017_06_01_preview/Sku.java | 61 + .../v2017_06_01_preview/SkuName.java | 47 + .../v2017_06_01_preview/SkuTier.java | 41 + .../v2017_06_01_preview/Source.java | 72 + .../v2017_06_01_preview/Status.java | 64 + .../StorageAccountProperties.java | 44 + .../v2017_06_01_preview/Target.java | 200 ++ .../v2017_06_01_preview/Webhook.java | 247 +++ .../v2017_06_01_preview/WebhookAction.java | 41 + .../WebhookCreateParameters.java | 208 ++ .../v2017_06_01_preview/WebhookStatus.java | 41 + .../WebhookUpdateParameters.java | 181 ++ .../v2017_06_01_preview/Webhooks.java | 86 + .../implementation/CallbackConfigImpl.java | 37 + .../implementation/CallbackConfigInner.java | 70 + ...ContainerRegistryManagementClientImpl.java | 238 ++ .../ContainerRegistryManager.java | 135 ++ .../implementation/EventImpl.java | 43 + .../implementation/EventInfoImpl.java | 31 + .../implementation/EventInfoInner.java | 43 + .../implementation/EventInner.java | 71 + .../implementation/IdParsingUtils.java | 57 + .../OperationDefinitionImpl.java | 37 + .../OperationDefinitionInner.java | 70 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 +++ .../implementation/PageImpl.java | 75 + .../implementation/RegistriesImpl.java | 190 ++ .../implementation/RegistriesInner.java | 1512 +++++++++++++ .../implementation/RegistryImpl.java | 137 ++ .../implementation/RegistryInner.java | 167 ++ .../RegistryListCredentialsResultImpl.java | 38 + .../RegistryListCredentialsResultInner.java | 71 + .../RegistryNameStatusImpl.java | 41 + .../RegistryNameStatusInner.java | 97 + .../RegistryUsageListResultImpl.java | 33 + .../RegistryUsageListResultInner.java | 45 + .../implementation/ReplicationImpl.java | 129 ++ .../implementation/ReplicationInner.java | 54 + .../implementation/ReplicationsImpl.java | 81 + .../implementation/ReplicationsInner.java | 1138 ++++++++++ .../implementation/WebhookImpl.java | 222 ++ .../implementation/WebhookInner.java | 123 ++ .../implementation/WebhooksImpl.java | 126 ++ .../implementation/WebhooksInner.java | 1418 ++++++++++++ .../implementation/package-info.java | 10 + .../v2017_06_01_preview/package-info.java | 10 + .../resource-manager/v2017_10_01/pom.xml | 133 ++ .../containerregistry/v2017_10_01/Actor.java | 45 + .../v2017_10_01/CallbackConfig.java | 31 + .../containerregistry/v2017_10_01/Event.java | 35 + .../v2017_10_01/EventContent.java | 202 ++ .../v2017_10_01/EventInfo.java | 25 + .../v2017_10_01/EventRequestMessage.java | 148 ++ .../v2017_10_01/EventResponseMessage.java | 148 ++ .../v2017_10_01/ImportImageParameters.java | 126 ++ .../v2017_10_01/ImportMode.java | 41 + .../v2017_10_01/ImportSource.java | 80 + .../v2017_10_01/OperationDefinition.java | 30 + .../OperationDisplayDefinition.java | 121 ++ .../v2017_10_01/Operations.java | 27 + .../v2017_10_01/PasswordName.java | 53 + .../v2017_10_01/ProvisioningState.java | 53 + .../RegenerateCredentialParameters.java | 44 + .../v2017_10_01/Registries.java | 77 + .../v2017_10_01/Registry.java | 164 ++ .../RegistryListCredentialsResult.java | 31 + .../v2017_10_01/RegistryNameCheckRequest.java | 78 + .../v2017_10_01/RegistryNameStatus.java | 35 + .../v2017_10_01/RegistryPassword.java | 69 + .../v2017_10_01/RegistryUpdateParameters.java | 126 ++ .../v2017_10_01/RegistryUsage.java | 121 ++ .../v2017_10_01/RegistryUsageListResult.java | 26 + .../v2017_10_01/RegistryUsageUnit.java | 41 + .../v2017_10_01/Replication.java | 136 ++ .../ReplicationUpdateParameters.java | 44 + .../v2017_10_01/Replications.java | 53 + .../v2017_10_01/Request.java | 150 ++ .../containerregistry/v2017_10_01/Sku.java | 60 + .../v2017_10_01/SkuName.java | 47 + .../v2017_10_01/SkuTier.java | 47 + .../containerregistry/v2017_10_01/Source.java | 72 + .../containerregistry/v2017_10_01/Status.java | 64 + .../v2017_10_01/StorageAccountProperties.java | 44 + .../containerregistry/v2017_10_01/Target.java | 200 ++ .../v2017_10_01/Webhook.java | 247 +++ .../v2017_10_01/WebhookAction.java | 41 + .../v2017_10_01/WebhookCreateParameters.java | 208 ++ .../v2017_10_01/WebhookStatus.java | 41 + .../v2017_10_01/WebhookUpdateParameters.java | 181 ++ .../v2017_10_01/Webhooks.java | 86 + .../implementation/CallbackConfigImpl.java | 37 + .../implementation/CallbackConfigInner.java | 70 + ...ContainerRegistryManagementClientImpl.java | 238 ++ .../ContainerRegistryManager.java | 135 ++ .../v2017_10_01/implementation/EventImpl.java | 43 + .../implementation/EventInfoImpl.java | 31 + .../implementation/EventInfoInner.java | 43 + .../implementation/EventInner.java | 71 + .../implementation/IdParsingUtils.java | 57 + .../OperationDefinitionImpl.java | 37 + .../OperationDefinitionInner.java | 70 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 283 +++ .../v2017_10_01/implementation/PageImpl.java | 75 + .../implementation/RegistriesImpl.java | 197 ++ .../implementation/RegistriesInner.java | 1691 +++++++++++++++ .../implementation/RegistryImpl.java | 137 ++ .../implementation/RegistryInner.java | 167 ++ .../RegistryListCredentialsResultImpl.java | 38 + .../RegistryListCredentialsResultInner.java | 71 + .../RegistryNameStatusImpl.java | 41 + .../RegistryNameStatusInner.java | 97 + .../RegistryUsageListResultImpl.java | 33 + .../RegistryUsageListResultInner.java | 45 + .../implementation/ReplicationImpl.java | 129 ++ .../implementation/ReplicationInner.java | 54 + .../implementation/ReplicationsImpl.java | 81 + .../implementation/ReplicationsInner.java | 1138 ++++++++++ .../implementation/WebhookImpl.java | 222 ++ .../implementation/WebhookInner.java | 123 ++ .../implementation/WebhooksImpl.java | 126 ++ .../implementation/WebhooksInner.java | 1418 ++++++++++++ .../implementation/package-info.java | 10 + .../v2017_10_01/package-info.java | 10 + .../v2018_02_01_preview/pom.xml | 133 ++ .../v2018_02_01_preview/Actor.java | 45 + .../BaseImageDependency.java | 148 ++ .../BaseImageDependencyType.java | 41 + .../BaseImageTriggerType.java | 44 + .../v2018_02_01_preview/Build.java | 122 ++ .../v2018_02_01_preview/BuildArgument.java | 40 + .../v2018_02_01_preview/BuildFilter.java | 229 ++ .../BuildGetLogResult.java | 25 + .../v2018_02_01_preview/BuildStatus.java | 59 + .../v2018_02_01_preview/BuildStep.java | 111 + .../BuildStepProperties.java | 41 + .../BuildStepPropertiesUpdateParameters.java | 24 + .../BuildStepUpdateParameters.java | 70 + .../v2018_02_01_preview/BuildSteps.java | 68 + .../v2018_02_01_preview/BuildTask.java | 263 +++ .../BuildTaskBuildRequest.java | 47 + .../v2018_02_01_preview/BuildTaskFilter.java | 43 + .../v2018_02_01_preview/BuildTaskStatus.java | 41 + .../BuildTaskUpdateParameters.java | 177 ++ .../v2018_02_01_preview/BuildTasks.java | 64 + .../v2018_02_01_preview/BuildType.java | 41 + .../BuildUpdateParameters.java | 43 + .../v2018_02_01_preview/Builds.java | 63 + .../v2018_02_01_preview/CallbackConfig.java | 31 + .../v2018_02_01_preview/DockerBuildStep.java | 249 +++ .../DockerBuildStepUpdateParameters.java | 234 ++ .../v2018_02_01_preview/Event.java | 35 + .../v2018_02_01_preview/EventContent.java | 202 ++ .../v2018_02_01_preview/EventInfo.java | 25 + .../EventRequestMessage.java | 148 ++ .../EventResponseMessage.java | 148 ++ .../v2018_02_01_preview/GitCommitTrigger.java | 147 ++ .../v2018_02_01_preview/ImageDescriptor.java | 121 ++ .../ImageUpdateTrigger.java | 97 + .../ImportImageParameters.java | 126 ++ .../v2018_02_01_preview/ImportMode.java | 41 + .../v2018_02_01_preview/ImportSource.java | 80 + .../OperationDefinition.java | 30 + .../OperationDisplayDefinition.java | 121 ++ .../v2018_02_01_preview/Operations.java | 27 + .../v2018_02_01_preview/OsType.java | 41 + .../v2018_02_01_preview/PasswordName.java | 53 + .../PlatformProperties.java | 71 + .../ProvisioningState.java | 53 + .../QueueBuildRequest.java | 25 + .../QuickBuildRequest.java | 239 ++ .../RegenerateCredentialParameters.java | 44 + .../v2018_02_01_preview/Registries.java | 98 + .../v2018_02_01_preview/Registry.java | 164 ++ .../RegistryListCredentialsResult.java | 31 + .../RegistryNameCheckRequest.java | 78 + .../RegistryNameStatus.java | 35 + .../v2018_02_01_preview/RegistryPassword.java | 69 + .../RegistryUpdateParameters.java | 126 ++ .../v2018_02_01_preview/RegistryUsage.java | 121 ++ .../RegistryUsageListResult.java | 26 + .../RegistryUsageUnit.java | 41 + .../v2018_02_01_preview/Replication.java | 136 ++ .../ReplicationUpdateParameters.java | 44 + .../v2018_02_01_preview/Replications.java | 53 + .../v2018_02_01_preview/Request.java | 150 ++ .../v2018_02_01_preview/Sku.java | 60 + .../v2018_02_01_preview/SkuName.java | 47 + .../v2018_02_01_preview/SkuTier.java | 47 + .../v2018_02_01_preview/Source.java | 72 + .../SourceControlAuthInfo.java | 147 ++ .../SourceControlType.java | 41 + .../SourceRepositoryProperties.java | 40 + .../SourceRepositoryUpdateParameters.java | 70 + .../SourceUploadDefinition.java | 30 + .../v2018_02_01_preview/Status.java | 64 + .../StorageAccountProperties.java | 44 + .../v2018_02_01_preview/Target.java | 200 ++ .../v2018_02_01_preview/TokenType.java | 41 + .../v2018_02_01_preview/Webhook.java | 247 +++ .../v2018_02_01_preview/WebhookAction.java | 41 + .../WebhookCreateParameters.java | 208 ++ .../v2018_02_01_preview/WebhookStatus.java | 41 + .../WebhookUpdateParameters.java | 181 ++ .../v2018_02_01_preview/Webhooks.java | 86 + .../implementation/BuildArgumentImpl.java | 46 + .../implementation/BuildArgumentInner.java | 131 ++ .../implementation/BuildGetLogResultImpl.java | 31 + .../BuildGetLogResultInner.java | 43 + .../implementation/BuildImpl.java | 165 ++ .../implementation/BuildInner.java | 396 ++++ .../implementation/BuildStepImpl.java | 139 ++ .../implementation/BuildStepInner.java | 45 + .../implementation/BuildStepsImpl.java | 100 + .../implementation/BuildStepsInner.java | 1445 +++++++++++++ .../implementation/BuildTaskImpl.java | 241 +++ .../implementation/BuildTaskInner.java | 187 ++ .../implementation/BuildTasksImpl.java | 94 + .../implementation/BuildTasksInner.java | 1178 ++++++++++ .../implementation/BuildsImpl.java | 85 + .../implementation/BuildsInner.java | 1149 ++++++++++ .../implementation/CallbackConfigImpl.java | 37 + .../implementation/CallbackConfigInner.java | 70 + ...ContainerRegistryManagementClientImpl.java | 267 +++ .../ContainerRegistryManager.java | 171 ++ .../implementation/EventImpl.java | 43 + .../implementation/EventInfoImpl.java | 31 + .../implementation/EventInfoInner.java | 43 + .../implementation/EventInner.java | 71 + .../implementation/IdParsingUtils.java | 57 + .../OperationDefinitionImpl.java | 37 + .../OperationDefinitionInner.java | 70 + .../implementation/OperationsImpl.java | 49 + .../implementation/OperationsInner.java | 281 +++ .../implementation/PageImpl.java | 75 + .../implementation/RegistriesImpl.java | 224 ++ .../implementation/RegistriesInner.java | 1926 +++++++++++++++++ .../implementation/RegistryImpl.java | 137 ++ .../implementation/RegistryInner.java | 167 ++ .../RegistryListCredentialsResultImpl.java | 38 + .../RegistryListCredentialsResultInner.java | 71 + .../RegistryNameStatusImpl.java | 41 + .../RegistryNameStatusInner.java | 97 + .../RegistryUsageListResultImpl.java | 33 + .../RegistryUsageListResultInner.java | 45 + .../implementation/ReplicationImpl.java | 129 ++ .../implementation/ReplicationInner.java | 54 + .../implementation/ReplicationsImpl.java | 81 + .../implementation/ReplicationsInner.java | 1118 ++++++++++ .../SourceRepositoryPropertiesImpl.java | 48 + .../SourceRepositoryPropertiesInner.java | 125 ++ .../SourceUploadDefinitionImpl.java | 36 + .../SourceUploadDefinitionInner.java | 70 + .../implementation/WebhookImpl.java | 222 ++ .../implementation/WebhookInner.java | 123 ++ .../implementation/WebhooksImpl.java | 126 ++ .../implementation/WebhooksInner.java | 1396 ++++++++++++ .../implementation/package-info.java | 10 + .../v2018_02_01_preview/package-info.java | 10 + 347 files changed, 48812 insertions(+) create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/pom.xml create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/Registries.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/Registry.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryCredentials.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryNameCheckRequest.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryNameStatus.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/StorageAccountProperties.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManagementClientImpl.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManager.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/IdParsingUtils.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/PageImpl.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesImpl.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryCredentialsImpl.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryCredentialsInner.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryImpl.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryInner.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryNameStatusImpl.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryNameStatusInner.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/package-info.java create mode 100644 containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/package-info.java create mode 100644 containerregistry/resource-manager/v2017_03_01/pom.xml create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/OperationDefinition.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/OperationDisplayDefinition.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Operations.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/PasswordName.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/ProvisioningState.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegenerateCredentialParameters.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Registries.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Registry.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryCreateParameters.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryListCredentialsResult.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryNameCheckRequest.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryNameStatus.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryPassword.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Sku.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/SkuTier.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/StorageAccountParameters.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/StorageAccountProperties.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManagementClientImpl.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManager.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/IdParsingUtils.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationDefinitionImpl.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationDefinitionInner.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationsImpl.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationsInner.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/PageImpl.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesImpl.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryImpl.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryInner.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryListCredentialsResultImpl.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryListCredentialsResultInner.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryNameStatusImpl.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryNameStatusInner.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/package-info.java create mode 100644 containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/package-info.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/pom.xml create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Actor.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/CallbackConfig.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Event.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventContent.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventInfo.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventRequestMessage.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventResponseMessage.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/OperationDefinition.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/OperationDisplayDefinition.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Operations.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/PasswordName.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/ProvisioningState.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegenerateCredentialParameters.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Registries.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Registry.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryListCredentialsResult.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryNameCheckRequest.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryNameStatus.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryPassword.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsage.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsageListResult.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsageUnit.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Replication.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/ReplicationUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Replications.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Request.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Sku.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/SkuName.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/SkuTier.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Source.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Status.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/StorageAccountProperties.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Target.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Webhook.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookAction.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookCreateParameters.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookStatus.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Webhooks.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/CallbackConfigImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/CallbackConfigInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManager.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInfoImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInfoInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/IdParsingUtils.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationDefinitionImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationDefinitionInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationsImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationsInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/PageImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryListCredentialsResultImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryListCredentialsResultInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryNameStatusImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryNameStatusInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryUsageListResultImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryUsageListResultInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhookImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhookInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhooksImpl.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhooksInner.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/package-info.java create mode 100644 containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/package-info.java create mode 100644 containerregistry/resource-manager/v2017_10_01/pom.xml create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Actor.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/CallbackConfig.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Event.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventContent.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventInfo.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventRequestMessage.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventResponseMessage.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportImageParameters.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportMode.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportSource.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/OperationDefinition.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/OperationDisplayDefinition.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Operations.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/PasswordName.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ProvisioningState.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegenerateCredentialParameters.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Registries.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Registry.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryListCredentialsResult.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryNameCheckRequest.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryNameStatus.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryPassword.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsage.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsageListResult.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsageUnit.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Replication.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ReplicationUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Replications.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Request.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Sku.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/SkuName.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/SkuTier.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Source.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Status.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/StorageAccountProperties.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Target.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Webhook.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookAction.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookCreateParameters.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookStatus.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Webhooks.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/CallbackConfigImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/CallbackConfigInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManagementClientImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManager.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInfoImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInfoInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/IdParsingUtils.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationDefinitionImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationDefinitionInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationsImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationsInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/PageImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryListCredentialsResultImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryListCredentialsResultInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryNameStatusImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryNameStatusInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryUsageListResultImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryUsageListResultInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationsImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationsInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhookImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhookInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhooksImpl.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhooksInner.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/package-info.java create mode 100644 containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/package-info.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/pom.xml create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Actor.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageDependency.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageDependencyType.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageTriggerType.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Build.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildArgument.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildFilter.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildGetLogResult.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStatus.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStep.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepProperties.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepPropertiesUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildSteps.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTask.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskBuildRequest.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskFilter.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskStatus.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTasks.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildType.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Builds.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/CallbackConfig.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/DockerBuildStep.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/DockerBuildStepUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Event.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventContent.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventInfo.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventRequestMessage.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventResponseMessage.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/GitCommitTrigger.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImageDescriptor.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImageUpdateTrigger.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportImageParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportMode.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportSource.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OperationDefinition.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OperationDisplayDefinition.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Operations.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OsType.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/PasswordName.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/PlatformProperties.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ProvisioningState.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/QueueBuildRequest.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/QuickBuildRequest.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegenerateCredentialParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Registries.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Registry.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryListCredentialsResult.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryNameCheckRequest.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryNameStatus.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryPassword.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsage.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsageListResult.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsageUnit.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Replication.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ReplicationUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Replications.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Request.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Sku.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SkuName.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SkuTier.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Source.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceControlAuthInfo.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceControlType.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceRepositoryProperties.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceRepositoryUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceUploadDefinition.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Status.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/StorageAccountProperties.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Target.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/TokenType.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Webhook.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookAction.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookCreateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookStatus.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookUpdateParameters.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Webhooks.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildArgumentImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildArgumentInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildGetLogResultImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildGetLogResultInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTaskImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTaskInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/CallbackConfigImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/CallbackConfigInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ContainerRegistryManagementClientImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ContainerRegistryManager.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInfoImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInfoInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/IdParsingUtils.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationDefinitionImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationDefinitionInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationsImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationsInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/PageImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryListCredentialsResultImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryListCredentialsResultInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryNameStatusImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryNameStatusInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryUsageListResultImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryUsageListResultInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationsImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationsInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceRepositoryPropertiesImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceRepositoryPropertiesInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceUploadDefinitionImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceUploadDefinitionInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhookImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhookInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhooksImpl.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhooksInner.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/package-info.java create mode 100644 containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/package-info.java diff --git a/containerregistry/resource-manager/v2016_06_27_preview/pom.xml b/containerregistry/resource-manager/v2016_06_27_preview/pom.xml new file mode 100644 index 0000000000000..f67dff8105923 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerregistry.v2016_06_27_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/Registries.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/Registries.java new file mode 100644 index 0000000000000..8c353d803b9d0 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/Registries.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation.RegistriesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Registries. + */ +public interface Registries extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Gets the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCredentialsAsync(String resourceGroupName, String registryName); + + /** + * Regenerates the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateCredentialsAsync(String resourceGroupName, String registryName); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 60 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/Registry.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/Registry.java new file mode 100644 index 0000000000000..4d407cfeafbc9 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/Registry.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.v2016_06_27_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation.RegistryInner; + +/** + * Type representing Registry. + */ +public interface Registry extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the loginServer value. + */ + String loginServer(); + + /** + * @return the storageAccount value. + */ + StorageAccountProperties storageAccount(); + + /** + * The entirety of the Registry definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of Registry definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Registry definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Registry definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the registry definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + WithCreate withStorageAccount(StorageAccountProperties storageAccount); + } + + /** + * The stage of the registry update allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdminUserEnabled { + } + } + /** + * The template for a Registry update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdminUserEnabled, UpdateStages.WithStorageAccount { + } + + /** + * Grouping of Registry update stages. + */ + interface UpdateStages { + /** + * The stage of the registry {0} allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry {0} allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + Update withStorageAccount(StorageAccountProperties storageAccount); + } + + } +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryCredentials.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryCredentials.java new file mode 100644 index 0000000000000..c43a0bbf7bc58 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryCredentials.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation.RegistryCredentialsInner; + +/** + * Type representing RegistryCredentials. + */ +public interface RegistryCredentials extends HasInner, HasManager { + /** + * @return the password value. + */ + String password(); + + /** + * @return the username value. + */ + String username(); + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryNameCheckRequest.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryNameCheckRequest.java new file mode 100644 index 0000000000000..0f5fe706c5be2 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryNameCheckRequest.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A request to check whether the container registry name is available. + */ +public class RegistryNameCheckRequest { + /** + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type of the container registry. This field must be set to + * "Microsoft.ContainerRegistry/registries". + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of RegistryNameCheckRequest class. + * @param name the name of the container registry. + */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name of the container registry. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container registry. + * + * @param name the name value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type of the container registry. This field must be set to "Microsoft.ContainerRegistry/registries". + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type of the container registry. This field must be set to "Microsoft.ContainerRegistry/registries". + * + * @param type the type value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryNameStatus.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryNameStatus.java new file mode 100644 index 0000000000000..cf7496dd89be1 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryNameStatus.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation.RegistryNameStatusInner; + +/** + * Type representing RegistryNameStatus. + */ +public interface RegistryNameStatus extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryUpdateParameters.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryUpdateParameters.java new file mode 100644 index 0000000000000..a7491eadeecad --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/RegistryUpdateParameters.java @@ -0,0 +1,101 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a container registry. + */ +@JsonFlatten +public class RegistryUpdateParameters { + /** + * The resource tags for the container registry. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The value that indicates whether the admin user is enabled. This value + * is false by default. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The properties of a storage account for the container registry. If + * specified, the storage account must be in the same physical location as + * the container registry. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the resource tags for the container registry. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the resource tags for the container registry. + * + * @param tags the tags value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the value that indicates whether the admin user is enabled. This value is false by default. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. This value is false by default. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the properties of a storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the properties of a storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/StorageAccountProperties.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/StorageAccountProperties.java new file mode 100644 index 0000000000000..126b36fb5504d --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/StorageAccountProperties.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.v2016_06_27_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a storage account for a container registry. + */ +public class StorageAccountProperties { + /** + * The name of the storage account. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The access key to the storage account. + */ + @JsonProperty(value = "accessKey", required = true) + private String accessKey; + + /** + * Get the name of the storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the storage account. + * + * @param name the name value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withName(String name) { + this.name = name; + return this; + } + + /** + * Get the access key to the storage account. + * + * @return the accessKey value + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the access key to the storage account. + * + * @param accessKey the accessKey value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 0000000000000..ede50ef774eda --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManagementClientImpl.java @@ -0,0 +1,196 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerRegistryManagementClientImpl class. + */ +public class ContainerRegistryManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The 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; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The RegistriesInner object to access its operations. + */ + private RegistriesInner registries; + + /** + * Gets the RegistriesInner object to access its operations. + * @return the RegistriesInner object. + */ + public RegistriesInner registries() { + return this.registries; + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerRegistryManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2016-06-27-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.registries = new RegistriesInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2016-06-27-preview"); + } +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManager.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManager.java new file mode 100644 index 0000000000000..912013df7634f --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/ContainerRegistryManager.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerRegistry resource management. + */ +public final class ContainerRegistryManager extends ManagerCore { + private Registries registries; + /** + * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerRegistryManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerRegistryManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerRegistryManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerRegistry management API entry points that work across subscriptions + */ + ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(this); + } + return this.registries; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerRegistryManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerRegistryManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerRegistryManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/IdParsingUtils.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..b76946a697a47 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/PageImpl.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..8314dbbe98c08 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesImpl.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..04ad5ccf975f7 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesImpl.java @@ -0,0 +1,176 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registry; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.RegistryCredentials; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.RegistryNameStatus; + +class RegistriesImpl extends GroupableResourcesCoreImpl implements Registries { + protected RegistriesImpl(ContainerRegistryManager manager) { + super(manager.inner().registries(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RegistriesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RegistriesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RegistriesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RegistriesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RegistryImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable getCredentialsAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.getCredentialsAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryCredentials call(RegistryCredentialsInner inner) { + return new RegistryCredentialsImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateCredentialsAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.regenerateCredentialsAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryCredentials call(RegistryCredentialsInner inner) { + return new RegistryCredentialsImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + RegistriesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public RegistryNameStatus call(RegistryNameStatusInner inner) { + return new RegistryNameStatusImpl(inner, manager()); + } + }); + } + + @Override + protected RegistryImpl wrapModel(RegistryInner inner) { + return new RegistryImpl(inner.name(), inner, manager()); + } + + @Override + protected RegistryImpl wrapModel(String name) { + return new RegistryImpl(name, new RegistryInner(), this.manager()); + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java new file mode 100644 index 0000000000000..f19f37d397d87 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistriesInner.java @@ -0,0 +1,1175 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.RegistryNameCheckRequest; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.RegistryUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Registries. + */ +public class RegistriesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RegistriesService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RegistriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Registries to be + * used by Retrofit to perform actually REST calls. + */ + interface RegistriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegistryNameCheckRequest registryNameCheckRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries getCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/getCredentials") + Observable> getCredentials(@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.v2016_06_27_preview.Registries regenerateCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredentials") + Observable> regenerateCredentials(@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.v2016_06_27_preview.Registries listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registries listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 60 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryNameStatusInner object if successful. + */ + public RegistryNameStatusInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 60 characters in length. + * + * @param name The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 60 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, RegistryNameStatusInner>() { + @Override + public RegistryNameStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 60 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (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."); + } + RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); + registryNameCheckRequest.withName(name); + 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) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates or updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating or updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner createOrUpdate(String resourceGroupName, String registryName, RegistryInner registry) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().single().body(); + } + + /** + * Creates or updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating or updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates or updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating or updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates or updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating or updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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.createOrUpdate(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) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(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); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String registryName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner update(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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.update(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) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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 available container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available container registries under the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + 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) { + 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 administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryCredentialsInner object if successful. + */ + public RegistryCredentialsInner getCredentials(String resourceGroupName, String registryName) { + return getCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCredentialsAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCredentialsWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryCredentialsInner object + */ + public Observable getCredentialsAsync(String resourceGroupName, String registryName) { + return getCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryCredentialsInner>() { + @Override + public RegistryCredentialsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryCredentialsInner object + */ + public Observable> getCredentialsWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.getCredentials(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryCredentialsInner object if successful. + */ + public RegistryCredentialsInner regenerateCredentials(String resourceGroupName, String registryName) { + return regenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Regenerates the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateCredentialsAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Regenerates the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryCredentialsInner object + */ + public Observable regenerateCredentialsAsync(String resourceGroupName, String registryName) { + return regenerateCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryCredentialsInner>() { + @Override + public RegistryCredentialsInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates the administrator login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryCredentialsInner object + */ + public Observable> regenerateCredentialsWithServiceResponseAsync(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."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.regenerateCredentials(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateCredentialsDelegate(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 available container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available container registries under the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the available container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the available container registries under the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryCredentialsImpl.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryCredentialsImpl.java new file mode 100644 index 0000000000000..e490d66392d51 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryCredentialsImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.RegistryCredentials; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryCredentialsImpl extends WrapperImpl implements RegistryCredentials { + private final ContainerRegistryManager manager; + RegistryCredentialsImpl(RegistryCredentialsInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String password() { + return this.inner().password(); + } + + @Override + public String username() { + return this.inner().username(); + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryCredentialsInner.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryCredentialsInner.java new file mode 100644 index 0000000000000..c83568927e092 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryCredentialsInner.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.v2016_06_27_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to get the administrator login credentials for a + * container registry. + */ +public class RegistryCredentialsInner { + /** + * The administrator username. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The administrator password. + */ + @JsonProperty(value = "password") + private String password; + + /** + * Get the administrator username. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the administrator username. + * + * @param username the username value to set + * @return the RegistryCredentialsInner object itself. + */ + public RegistryCredentialsInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the administrator password. + * + * @return the password value + */ + public String password() { + return this.password; + } + + /** + * Set the administrator password. + * + * @param password the password value to set + * @return the RegistryCredentialsInner object itself. + */ + public RegistryCredentialsInner withPassword(String password) { + this.password = password; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryImpl.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..ace4c28f2e85f --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.Registry; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.RegistryUpdateParameters; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.StorageAccountProperties; +import rx.functions.Func1; + +class RegistryImpl extends GroupableResourceCoreImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryUpdateParameters updateParameter; + RegistryImpl(String name, RegistryInner inner, ContainerRegistryManager manager) { + super(name, inner, manager); + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.createOrUpdateAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Boolean adminUserEnabled() { + return this.inner().adminUserEnabled(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String loginServer() { + return this.inner().loginServer(); + } + + @Override + public StorageAccountProperties storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public RegistryImpl withStorageAccount(StorageAccountProperties storageAccount) { + if (isInCreateMode()) { + this.inner().withStorageAccount(storageAccount); + } else { + this.updateParameter.withStorageAccount(storageAccount); + } + return this; + } + + @Override + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.inner().withAdminUserEnabled(adminUserEnabled); + } else { + this.updateParameter.withAdminUserEnabled(adminUserEnabled); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryInner.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryInner.java new file mode 100644 index 0000000000000..a720791470809 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryInner.java @@ -0,0 +1,107 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.StorageAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a container registry. + */ +@JsonFlatten +public class RegistryInner extends Resource { + /** + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "properties.loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /** + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The value that indicates whether the admin user is enabled. This value + * is false by default. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The properties of the storage account for the container registry. If + * specified, the storage account must be in the same physical location as + * the container registry. + */ + @JsonProperty(value = "properties.storageAccount", required = true) + private StorageAccountProperties storageAccount; + + /** + * Get the URL that can be used to log into the container registry. + * + * @return the loginServer value + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creation date of the container registry in ISO8601 format. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the value that indicates whether the admin user is enabled. This value is false by default. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. This value is false by default. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the properties of the storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the properties of the storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryNameStatusImpl.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryNameStatusImpl.java new file mode 100644 index 0000000000000..2609848c34ca1 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2016_06_27_preview.RegistryNameStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryNameStatusImpl extends WrapperImpl implements RegistryNameStatus { + private final ContainerRegistryManager manager; + RegistryNameStatusImpl(RegistryNameStatusInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryNameStatusInner.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryNameStatusInner.java new file mode 100644 index 0000000000000..852758ad4c291 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/RegistryNameStatusInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to check the availability of a container registry + * name. + */ +public class RegistryNameStatusInner { + /** + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value that indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the value that indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get if any, the reason that the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set if any, the reason that the name is not available. + * + * @param reason the reason value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get if any, the error message that provides more detail for the reason that the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if any, the error message that provides more detail for the reason that the name is not available. + * + * @param message the message value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/package-info.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/package-info.java new file mode 100644 index 0000000000000..8564137489b98 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview.implementation; diff --git a/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/package-info.java b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/package-info.java new file mode 100644 index 0000000000000..b0e9da37ee310 --- /dev/null +++ b/containerregistry/resource-manager/v2016_06_27_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2016_06_27_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2016_06_27_preview; diff --git a/containerregistry/resource-manager/v2017_03_01/pom.xml b/containerregistry/resource-manager/v2017_03_01/pom.xml new file mode 100644 index 0000000000000..3364f532ec88b --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerregistry.v2017_03_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/OperationDefinition.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/OperationDefinition.java new file mode 100644 index 0000000000000..52cb0fb53839a --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/OperationDefinition.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.OperationDefinitionInner; + +/** + * Type representing OperationDefinition. + */ +public interface OperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplayDefinition display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/OperationDisplayDefinition.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/OperationDisplayDefinition.java new file mode 100644 index 0000000000000..dc5e2a1db602a --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/OperationDisplayDefinition.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a container registry operation. + */ +public class OperationDisplayDefinition { + /** + * The resource provider name: Microsoft.ContainerRegistry. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the resource provider name: Microsoft.ContainerRegistry. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the resource provider name: Microsoft.ContainerRegistry. + * + * @param provider the provider value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that users can perform. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that users can perform. + * + * @param operation the operation value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the operation. + * + * @param description the description value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Operations.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Operations.java new file mode 100644 index 0000000000000..37ff3b75fcd51 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/PasswordName.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/PasswordName.java new file mode 100644 index 0000000000000..d7d9efa5d15cc --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/PasswordName.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PasswordName. + */ +public enum PasswordName { + /** Enum value password. */ + PASSWORD("password"), + + /** Enum value password2. */ + PASSWORD2("password2"); + + /** The actual serialized value for a PasswordName instance. */ + private String value; + + PasswordName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PasswordName instance. + * + * @param value the serialized value to parse. + * @return the parsed PasswordName object, or null if unable to parse. + */ + @JsonCreator + public static PasswordName fromString(String value) { + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/ProvisioningState.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/ProvisioningState.java new file mode 100644 index 0000000000000..7c2904d6fc9a9 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for ProvisioningState. + */ +public enum ProvisioningState { + /** Enum value Creating. */ + CREATING("Creating"), + + /** Enum value Succeeded. */ + SUCCEEDED("Succeeded"); + + /** The actual serialized value for a ProvisioningState instance. */ + private String value; + + ProvisioningState(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a ProvisioningState instance. + * + * @param value the serialized value to parse. + * @return the parsed ProvisioningState object, or null if unable to parse. + */ + @JsonCreator + public static ProvisioningState fromString(String value) { + ProvisioningState[] items = ProvisioningState.values(); + for (ProvisioningState item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegenerateCredentialParameters.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegenerateCredentialParameters.java new file mode 100644 index 0000000000000..7ec7356614ac1 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegenerateCredentialParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the login credential. + */ +public class RegenerateCredentialParameters { + /** + * Specifies name of the password which should be regenerated -- password + * or password2. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** + * Get specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegenerateCredentialParameters object itself. + */ + public RegenerateCredentialParameters withName(PasswordName name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Registries.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Registries.java new file mode 100644 index 0000000000000..fc4fac22ecf33 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Registries.java @@ -0,0 +1,55 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.RegistriesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Registries. + */ +public interface Registries extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCredentialsAsync(String resourceGroupName, String registryName); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Registry.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Registry.java new file mode 100644 index 0000000000000..b52bf29808522 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Registry.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.RegistryInner; + +/** + * Type representing Registry. + */ +public interface Registry extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the loginServer value. + */ + String loginServer(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the storageAccount value. + */ + StorageAccountProperties storageAccount(); + + /** + * The entirety of the Registry definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithStorageAccount, DefinitionStages.WithCreate { + } + + /** + * Grouping of Registry definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Registry definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Registry definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the registry definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithStorageAccount withSku(Sku sku); + } + + /** + * The stage of the registry definition allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + WithCreate withStorageAccount(StorageAccountParameters storageAccount); + } + + /** + * The stage of the registry update allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdminUserEnabled { + } + } + /** + * The template for a Registry update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdminUserEnabled, UpdateStages.WithStorageAccount { + } + + /** + * Grouping of Registry update stages. + */ + interface UpdateStages { + /** + * The stage of the registry {0} allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry {0} allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + Update withStorageAccount(StorageAccountParameters storageAccount); + } + + } +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryCreateParameters.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryCreateParameters.java new file mode 100644 index 0000000000000..089b4c573d3a7 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryCreateParameters.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for creating a container registry. + */ +@JsonFlatten +public class RegistryCreateParameters { + /** + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The location of the container registry. This cannot be changed after the + * resource is created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The parameters of a storage account for the container registry. If + * specified, the storage account must be in the same physical location as + * the container registry. + */ + @JsonProperty(value = "properties.storageAccount", required = true) + private StorageAccountParameters storageAccount; + + /** + * Get the tags for the container registry. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the container registry. + * + * @param tags the tags value to set + * @return the RegistryCreateParameters object itself. + */ + public RegistryCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location of the container registry. This cannot be changed after the resource is created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the container registry. This cannot be changed after the resource is created. + * + * @param location the location value to set + * @return the RegistryCreateParameters object itself. + */ + public RegistryCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryCreateParameters object itself. + */ + public RegistryCreateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryCreateParameters object itself. + */ + public RegistryCreateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the parameters of a storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry. + * + * @return the storageAccount value + */ + public StorageAccountParameters storageAccount() { + return this.storageAccount; + } + + /** + * Set the parameters of a storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryCreateParameters object itself. + */ + public RegistryCreateParameters withStorageAccount(StorageAccountParameters storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryListCredentialsResult.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryListCredentialsResult.java new file mode 100644 index 0000000000000..6a64a0603c4be --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryListCredentialsResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.RegistryListCredentialsResultInner; +import java.util.List; + +/** + * Type representing RegistryListCredentialsResult. + */ +public interface RegistryListCredentialsResult extends HasInner, HasManager { + /** + * @return the passwords value. + */ + List passwords(); + + /** + * @return the username value. + */ + String username(); + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryNameCheckRequest.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryNameCheckRequest.java new file mode 100644 index 0000000000000..fa3852d8fb04e --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryNameCheckRequest.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A request to check whether a container registry name is available. + */ +public class RegistryNameCheckRequest { + /** + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of RegistryNameCheckRequest class. + * @param name the name of the container registry. + */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name of the container registry. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container registry. + * + * @param name the name value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @param type the type value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryNameStatus.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryNameStatus.java new file mode 100644 index 0000000000000..96d11b81c53ca --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryNameStatus.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_03_01.implementation.RegistryNameStatusInner; + +/** + * Type representing RegistryNameStatus. + */ +public interface RegistryNameStatus extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryPassword.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryPassword.java new file mode 100644 index 0000000000000..5727a841c157f --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryPassword.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The login password for the container registry. + */ +public class RegistryPassword { + /** + * The password name. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /** + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the password name. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the password name. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Get the password value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the password value. + * + * @param value the value value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryUpdateParameters.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryUpdateParameters.java new file mode 100644 index 0000000000000..c1312bd3f952f --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/RegistryUpdateParameters.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a container registry. + */ +@JsonFlatten +public class RegistryUpdateParameters { + /** + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The parameters of a storage account for the container registry. If + * specified, the storage account must be in the same physical location as + * the container registry. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountParameters storageAccount; + + /** + * Get the tags for the container registry. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the container registry. + * + * @param tags the tags value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the parameters of a storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry. + * + * @return the storageAccount value + */ + public StorageAccountParameters storageAccount() { + return this.storageAccount; + } + + /** + * Set the parameters of a storage account for the container registry. If specified, the storage account must be in the same physical location as the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withStorageAccount(StorageAccountParameters storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Sku.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Sku.java new file mode 100644 index 0000000000000..91795ec7d06ee --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/Sku.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.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of a container registry. + */ +public class Sku { + /** + * The SKU name of the container registry. Required for registry creation. + * Allowed value: Basic. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The SKU tier based on the SKU name. Possible values include: 'Basic'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the SKU name of the container registry. Required for registry creation. Allowed value: Basic. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the SKU name of the container registry. Required for registry creation. Allowed value: Basic. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(String name) { + this.name = name; + return this; + } + + /** + * Get the SKU tier based on the SKU name. Possible values include: 'Basic'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/SkuTier.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/SkuTier.java new file mode 100644 index 0000000000000..29603f18b5723 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/SkuTier.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/StorageAccountParameters.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/StorageAccountParameters.java new file mode 100644 index 0000000000000..e2806b484ba1a --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/StorageAccountParameters.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.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters of a storage account for a container registry. + */ +public class StorageAccountParameters { + /** + * The name of the storage account. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The access key to the storage account. + */ + @JsonProperty(value = "accessKey", required = true) + private String accessKey; + + /** + * Get the name of the storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the storage account. + * + * @param name the name value to set + * @return the StorageAccountParameters object itself. + */ + public StorageAccountParameters withName(String name) { + this.name = name; + return this; + } + + /** + * Get the access key to the storage account. + * + * @return the accessKey value + */ + public String accessKey() { + return this.accessKey; + } + + /** + * Set the access key to the storage account. + * + * @param accessKey the accessKey value to set + * @return the StorageAccountParameters object itself. + */ + public StorageAccountParameters withAccessKey(String accessKey) { + this.accessKey = accessKey; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/StorageAccountProperties.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/StorageAccountProperties.java new file mode 100644 index 0000000000000..a9ac33197f2bf --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/StorageAccountProperties.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.v2017_03_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a storage account for a container registry. + */ +public class StorageAccountProperties { + /** + * The name of the storage account. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the name of the storage account. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the storage account. + * + * @param name the name value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 0000000000000..b2ab1bf2c8e57 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManagementClientImpl.java @@ -0,0 +1,210 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerRegistryManagementClientImpl class. + */ +public class ContainerRegistryManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The 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; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The RegistriesInner object to access its operations. + */ + private RegistriesInner registries; + + /** + * Gets the RegistriesInner object to access its operations. + * @return the RegistriesInner object. + */ + public RegistriesInner registries() { + return this.registries; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerRegistryManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-03-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.registries = new RegistriesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2017-03-01"); + } +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManager.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManager.java new file mode 100644 index 0000000000000..d6b5951f4cfb0 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/ContainerRegistryManager.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerregistry.v2017_03_01.Registries; +import com.microsoft.azure.management.containerregistry.v2017_03_01.Operations; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerRegistry resource management. + */ +public final class ContainerRegistryManager extends ManagerCore { + private Registries registries; + private Operations operations; + /** + * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerRegistryManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerRegistryManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerRegistryManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerRegistry management API entry points that work across subscriptions + */ + ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(this); + } + return this.registries; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerRegistryManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerRegistryManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerRegistryManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/IdParsingUtils.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..ecaef9c6a41e3 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationDefinitionImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationDefinitionImpl.java new file mode 100644 index 0000000000000..b5727aaa86c3c --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationDefinitionImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_03_01.OperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_03_01.OperationDisplayDefinition; + +class OperationDefinitionImpl extends WrapperImpl implements OperationDefinition { + private final ContainerRegistryManager manager; + OperationDefinitionImpl(OperationDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public OperationDisplayDefinition display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationDefinitionInner.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationDefinitionInner.java new file mode 100644 index 0000000000000..13e02904a26a7 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationDefinitionInner.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.v2017_03_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_03_01.OperationDisplayDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a container registry operation. + */ +public class OperationDefinitionInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information for the container registry operation. + * + * @return the display value + */ + public OperationDisplayDefinition display() { + return this.display; + } + + /** + * Set the display information for the container registry operation. + * + * @param display the display value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { + this.display = display; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationsImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..c47426e584306 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_03_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_03_01.OperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerRegistryManager manager; + + OperationsImpl(ContainerRegistryManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationDefinition call(OperationDefinitionInner inner) { + return new OperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationsInner.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..845c7fd0bef83 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Operations list" }) + @GET("providers/Microsoft.ContainerRegistry/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/PageImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..bdeacde678ff3 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..7c38797ba875a --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesImpl.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerregistry.v2017_03_01.Registries; +import com.microsoft.azure.management.containerregistry.v2017_03_01.Registry; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryListCredentialsResult; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryNameStatus; +import com.microsoft.azure.management.containerregistry.v2017_03_01.PasswordName; + +class RegistriesImpl extends GroupableResourcesCoreImpl implements Registries { + protected RegistriesImpl(ContainerRegistryManager manager) { + super(manager.inner().registries(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RegistriesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RegistriesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RegistriesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RegistriesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RegistryImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listCredentialsAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + RegistriesInner client = this.inner(); + return client.regenerateCredentialAsync(resourceGroupName, registryName, name) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + RegistriesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public RegistryNameStatus call(RegistryNameStatusInner inner) { + return new RegistryNameStatusImpl(inner, manager()); + } + }); + } + + @Override + protected RegistryImpl wrapModel(RegistryInner inner) { + return new RegistryImpl(inner.name(), inner, manager()); + } + + @Override + protected RegistryImpl wrapModel(String name) { + return new RegistryImpl(name, new RegistryInner(), this.manager()); + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java new file mode 100644 index 0000000000000..79fb0b21d25f3 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java @@ -0,0 +1,1268 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2017_03_01.PasswordName; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegenerateCredentialParameters; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryCreateParameters; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryNameCheckRequest; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Registries. + */ +public class RegistriesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RegistriesService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RegistriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Registries to be + * used by Retrofit to perform actually REST calls. + */ + interface RegistriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegistryNameCheckRequest registryNameCheckRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryCreateParameters registryCreateParameters, @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.v2017_03_01.Registries beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryCreateParameters registryCreateParameters, @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.v2017_03_01.Registries delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries listCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials") + Observable> listCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries regenerateCredential" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential") + Observable> regenerateCredential(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateCredentialParameters regenerateCredentialParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_03_01.Registries listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryNameStatusInner object if successful. + */ + public RegistryNameStatusInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, RegistryNameStatusInner>() { + @Override + public RegistryNameStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (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."); + } + RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); + registryNameCheckRequest.withName(name); + 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) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryCreateParameters The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner create(String resourceGroupName, String registryName, RegistryCreateParameters registryCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registryCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryCreateParameters The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, RegistryCreateParameters registryCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, registryCreateParameters), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryCreateParameters The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, RegistryCreateParameters registryCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registryCreateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryCreateParameters The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryCreateParameters registryCreateParameters) { + 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 (registryCreateParameters == null) { + throw new IllegalArgumentException("Parameter registryCreateParameters is required and cannot be null."); + } + Validator.validate(registryCreateParameters); + Observable> observable = service.create(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registryCreateParameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryCreateParameters The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginCreate(String resourceGroupName, String registryName, RegistryCreateParameters registryCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registryCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryCreateParameters The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, RegistryCreateParameters registryCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registryCreateParameters), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryCreateParameters The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, RegistryCreateParameters registryCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registryCreateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryCreateParameters The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryCreateParameters registryCreateParameters) { + 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 (registryCreateParameters == null) { + throw new IllegalArgumentException("Parameter registryCreateParameters is required and cannot be null."); + } + Validator.validate(registryCreateParameters); + return service.beginCreate(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), registryCreateParameters, 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(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String registryName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.delete(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner update(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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.update(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) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(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. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listCredentialsAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCredentialsWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> listCredentialsWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = listCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner regenerateCredential(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).toBlocking().single().body(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name), serviceCallback); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> regenerateCredentialWithServiceResponseAsync(String resourceGroupName, String registryName, PasswordName name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateCredentialDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateCredentialDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..999774a1ee328 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerregistry.v2017_03_01.Registry; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryCreateParameters; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_03_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_03_01.Sku; +import com.microsoft.azure.management.containerregistry.v2017_03_01.StorageAccountProperties; +import com.microsoft.azure.management.containerregistry.v2017_03_01.StorageAccountParameters; +import rx.functions.Func1; + +class RegistryImpl extends GroupableResourceCoreImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryCreateParameters createParameter; + private RegistryUpdateParameters updateParameter; + RegistryImpl(String name, RegistryInner inner, ContainerRegistryManager manager) { + super(name, inner, manager); + this.createParameter = new RegistryCreateParameters(); + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + this.createParameter.withLocation(inner().location()); + this.createParameter.withTags(inner().getTags()); + return client.createAsync(this.resourceGroupName(), this.name(), this.createParameter) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new RegistryCreateParameters(); + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Boolean adminUserEnabled() { + return this.inner().adminUserEnabled(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String loginServer() { + return this.inner().loginServer(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public StorageAccountProperties storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public RegistryImpl withSku(Sku sku) { + this.createParameter.withSku(sku); + return this; + } + + @Override + public RegistryImpl withStorageAccount(StorageAccountParameters storageAccount) { + if (isInCreateMode()) { + this.createParameter.withStorageAccount(storageAccount); + } else { + this.updateParameter.withStorageAccount(storageAccount); + } + return this; + } + + @Override + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.createParameter.withAdminUserEnabled(adminUserEnabled); + } else { + this.updateParameter.withAdminUserEnabled(adminUserEnabled); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryInner.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryInner.java new file mode 100644 index 0000000000000..35c876410a484 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryInner.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.v2017_03_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_03_01.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_03_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_03_01.StorageAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a container registry. + */ +@JsonFlatten +public class RegistryInner extends Resource { + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "properties.loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /** + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The provisioning state of the container registry at the time the + * operation was called. Possible values include: 'Creating', 'Succeeded'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The properties of the storage account for the container registry. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the URL that can be used to log into the container registry. + * + * @return the loginServer value + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creation date of the container registry in ISO8601 format. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Succeeded'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the properties of the storage account for the container registry. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the properties of the storage account for the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryListCredentialsResultImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryListCredentialsResultImpl.java new file mode 100644 index 0000000000000..c48248033ed6a --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryListCredentialsResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryListCredentialsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryPassword; + +class RegistryListCredentialsResultImpl extends WrapperImpl implements RegistryListCredentialsResult { + private final ContainerRegistryManager manager; + RegistryListCredentialsResultImpl(RegistryListCredentialsResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List passwords() { + return this.inner().passwords(); + } + + @Override + public String username() { + return this.inner().username(); + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryListCredentialsResultInner.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryListCredentialsResultInner.java new file mode 100644 index 0000000000000..7cb094b2a5b50 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryListCredentialsResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListCredentials operation. + */ +public class RegistryListCredentialsResultInner { + /** + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username for a container registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for a container registry. + * + * @param username the username value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the list of passwords for a container registry. + * + * @return the passwords value + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the list of passwords for a container registry. + * + * @param passwords the passwords value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryNameStatusImpl.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryNameStatusImpl.java new file mode 100644 index 0000000000000..f19178a63f028 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_03_01.RegistryNameStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryNameStatusImpl extends WrapperImpl implements RegistryNameStatus { + private final ContainerRegistryManager manager; + RegistryNameStatusImpl(RegistryNameStatusInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryNameStatusInner.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryNameStatusInner.java new file mode 100644 index 0000000000000..85a69d272ecff --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistryNameStatusInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to check the availability of a container registry + * name. + */ +public class RegistryNameStatusInner { + /** + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value that indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the value that indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get if any, the reason that the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set if any, the reason that the name is not available. + * + * @param reason the reason value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get if any, the error message that provides more detail for the reason that the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if any, the error message that provides more detail for the reason that the name is not available. + * + * @param message the message value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/package-info.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/package-info.java new file mode 100644 index 0000000000000..8bf4b768fc325 --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2017_03_01.implementation; diff --git a/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/package-info.java b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/package-info.java new file mode 100644 index 0000000000000..53d7bdd6fbd7c --- /dev/null +++ b/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2017_03_01; diff --git a/containerregistry/resource-manager/v2017_06_01_preview/pom.xml b/containerregistry/resource-manager/v2017_06_01_preview/pom.xml new file mode 100644 index 0000000000000..892957180a14b --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerregistry.v2017_06_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Actor.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Actor.java new file mode 100644 index 0000000000000..8a9a7bc49567c --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Actor.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The agent that initiated the event. For most situations, this could be from + * the authorization context of the request. + */ +public class Actor { + /** + * The subject or username associated with the request context that + * generated the event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the subject or username associated with the request context that generated the event. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the subject or username associated with the request context that generated the event. + * + * @param name the name value to set + * @return the Actor object itself. + */ + public Actor withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/CallbackConfig.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/CallbackConfig.java new file mode 100644 index 0000000000000..883f7b77b4b98 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/CallbackConfig.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.CallbackConfigInner; +import java.util.Map; + +/** + * Type representing CallbackConfig. + */ +public interface CallbackConfig extends HasInner, HasManager { + /** + * @return the customHeaders value. + */ + Map customHeaders(); + + /** + * @return the serviceUri value. + */ + String serviceUri(); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Event.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Event.java new file mode 100644 index 0000000000000..419bec71a97d2 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Event.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.EventInner; + +/** + * Type representing Event. + */ +public interface Event extends HasInner, HasManager { + /** + * @return the eventRequestMessage value. + */ + EventRequestMessage eventRequestMessage(); + + /** + * @return the eventResponseMessage value. + */ + EventResponseMessage eventResponseMessage(); + + /** + * @return the id value. + */ + String id(); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventContent.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventContent.java new file mode 100644 index 0000000000000..7fcb130113e2a --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventContent.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The content of the event request message. + */ +public class EventContent { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The time at which the event occurred. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * The action that encompasses the provided event. + */ + @JsonProperty(value = "action") + private String action; + + /** + * The target of the event. + */ + @JsonProperty(value = "target") + private Target target; + + /** + * The request that generated the event. + */ + @JsonProperty(value = "request") + private Request request; + + /** + * The agent that initiated the event. For most situations, this could be + * from the authorization context of the request. + */ + @JsonProperty(value = "actor") + private Actor actor; + + /** + * The registry node that generated the event. Put differently, while the + * actor initiates the event, the source generates it. + */ + @JsonProperty(value = "source") + private Source source; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventContent object itself. + */ + public EventContent withId(String id) { + this.id = id; + return this; + } + + /** + * Get the time at which the event occurred. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the time at which the event occurred. + * + * @param timestamp the timestamp value to set + * @return the EventContent object itself. + */ + public EventContent withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the action that encompasses the provided event. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the action that encompasses the provided event. + * + * @param action the action value to set + * @return the EventContent object itself. + */ + public EventContent withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the target of the event. + * + * @return the target value + */ + public Target target() { + return this.target; + } + + /** + * Set the target of the event. + * + * @param target the target value to set + * @return the EventContent object itself. + */ + public EventContent withTarget(Target target) { + this.target = target; + return this; + } + + /** + * Get the request that generated the event. + * + * @return the request value + */ + public Request request() { + return this.request; + } + + /** + * Set the request that generated the event. + * + * @param request the request value to set + * @return the EventContent object itself. + */ + public EventContent withRequest(Request request) { + this.request = request; + return this; + } + + /** + * Get the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @return the actor value + */ + public Actor actor() { + return this.actor; + } + + /** + * Set the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @param actor the actor value to set + * @return the EventContent object itself. + */ + public EventContent withActor(Actor actor) { + this.actor = actor; + return this; + } + + /** + * Get the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @return the source value + */ + public Source source() { + return this.source; + } + + /** + * Set the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @param source the source value to set + * @return the EventContent object itself. + */ + public EventContent withSource(Source source) { + this.source = source; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventInfo.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventInfo.java new file mode 100644 index 0000000000000..3f5b27640553d --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventInfo.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.EventInfoInner; + +/** + * Type representing EventInfo. + */ +public interface EventInfo extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventRequestMessage.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventRequestMessage.java new file mode 100644 index 0000000000000..48d7281f4bf13 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventRequestMessage.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event request message sent to the service URI. + */ +public class EventRequestMessage { + /** + * The content of the event request message. + */ + @JsonProperty(value = "content") + private EventContent content; + + /** + * The headers of the event request message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The HTTP method used to send the event request message. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The URI used to send the event request message. + */ + @JsonProperty(value = "requestUri") + private String requestUri; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event request message. + * + * @return the content value + */ + public EventContent content() { + return this.content; + } + + /** + * Set the content of the event request message. + * + * @param content the content value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withContent(EventContent content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event request message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event request message. + * + * @param headers the headers value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the HTTP method used to send the event request message. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the HTTP method used to send the event request message. + * + * @param method the method value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the URI used to send the event request message. + * + * @return the requestUri value + */ + public String requestUri() { + return this.requestUri; + } + + /** + * Set the URI used to send the event request message. + * + * @param requestUri the requestUri value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withRequestUri(String requestUri) { + this.requestUri = requestUri; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventResponseMessage.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventResponseMessage.java new file mode 100644 index 0000000000000..ec6f9bb17fabb --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/EventResponseMessage.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event response message received from the service URI. + */ +public class EventResponseMessage { + /** + * The content of the event response message. + */ + @JsonProperty(value = "content") + private String content; + + /** + * The headers of the event response message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The reason phrase of the event response message. + */ + @JsonProperty(value = "reasonPhrase") + private String reasonPhrase; + + /** + * The status code of the event response message. + */ + @JsonProperty(value = "statusCode") + private String statusCode; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event response message. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the event response message. + * + * @param content the content value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event response message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event response message. + * + * @param headers the headers value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the reason phrase of the event response message. + * + * @return the reasonPhrase value + */ + public String reasonPhrase() { + return this.reasonPhrase; + } + + /** + * Set the reason phrase of the event response message. + * + * @param reasonPhrase the reasonPhrase value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withReasonPhrase(String reasonPhrase) { + this.reasonPhrase = reasonPhrase; + return this; + } + + /** + * Get the status code of the event response message. + * + * @return the statusCode value + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the status code of the event response message. + * + * @param statusCode the statusCode value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/OperationDefinition.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/OperationDefinition.java new file mode 100644 index 0000000000000..c6003d9ee3351 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/OperationDefinition.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.OperationDefinitionInner; + +/** + * Type representing OperationDefinition. + */ +public interface OperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplayDefinition display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/OperationDisplayDefinition.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/OperationDisplayDefinition.java new file mode 100644 index 0000000000000..b3e5f05be9699 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/OperationDisplayDefinition.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a container registry operation. + */ +public class OperationDisplayDefinition { + /** + * The resource provider name: Microsoft.ContainerRegistry. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the resource provider name: Microsoft.ContainerRegistry. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the resource provider name: Microsoft.ContainerRegistry. + * + * @param provider the provider value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that users can perform. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that users can perform. + * + * @param operation the operation value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the operation. + * + * @param description the description value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Operations.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Operations.java new file mode 100644 index 0000000000000..41e43709ae7e6 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/PasswordName.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/PasswordName.java new file mode 100644 index 0000000000000..a408db337eca6 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/PasswordName.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PasswordName. + */ +public enum PasswordName { + /** Enum value password. */ + PASSWORD("password"), + + /** Enum value password2. */ + PASSWORD2("password2"); + + /** The actual serialized value for a PasswordName instance. */ + private String value; + + PasswordName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PasswordName instance. + * + * @param value the serialized value to parse. + * @return the parsed PasswordName object, or null if unable to parse. + */ + @JsonCreator + public static PasswordName fromString(String value) { + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/ProvisioningState.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/ProvisioningState.java new file mode 100644 index 0000000000000..c8d6f97bfc1e1 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegenerateCredentialParameters.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegenerateCredentialParameters.java new file mode 100644 index 0000000000000..f1c3b5b1faf94 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegenerateCredentialParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the login credential. + */ +public class RegenerateCredentialParameters { + /** + * Specifies name of the password which should be regenerated -- password + * or password2. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** + * Get specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegenerateCredentialParameters object itself. + */ + public RegenerateCredentialParameters withName(PasswordName name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Registries.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Registries.java new file mode 100644 index 0000000000000..8d0126e99ba18 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Registries.java @@ -0,0 +1,65 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.RegistriesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Registries. + */ +public interface Registries extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCredentialsAsync(String resourceGroupName, String registryName); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String resourceGroupName, String registryName); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Registry.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Registry.java new file mode 100644 index 0000000000000..f4441e03be21e --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Registry.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.RegistryInner; + +/** + * Type representing Registry. + */ +public interface Registry extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the loginServer value. + */ + String loginServer(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the storageAccount value. + */ + StorageAccountProperties storageAccount(); + + /** + * The entirety of the Registry definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of Registry definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Registry definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Registry definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the registry definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the registry update allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry update allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + WithCreate withStorageAccount(StorageAccountProperties storageAccount); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdminUserEnabled, DefinitionStages.WithStorageAccount { + } + } + /** + * The template for a Registry update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdminUserEnabled, UpdateStages.WithSku, UpdateStages.WithStorageAccount { + } + + /** + * Grouping of Registry update stages. + */ + interface UpdateStages { + /** + * The stage of the registry {0} allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(Sku sku); + } + + /** + * The stage of the registry {0} allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + Update withStorageAccount(StorageAccountProperties storageAccount); + } + + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryListCredentialsResult.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryListCredentialsResult.java new file mode 100644 index 0000000000000..658acad8d4f67 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryListCredentialsResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.RegistryListCredentialsResultInner; +import java.util.List; + +/** + * Type representing RegistryListCredentialsResult. + */ +public interface RegistryListCredentialsResult extends HasInner, HasManager { + /** + * @return the passwords value. + */ + List passwords(); + + /** + * @return the username value. + */ + String username(); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryNameCheckRequest.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryNameCheckRequest.java new file mode 100644 index 0000000000000..4cf0d2bdb9648 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryNameCheckRequest.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A request to check whether a container registry name is available. + */ +public class RegistryNameCheckRequest { + /** + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of RegistryNameCheckRequest class. + * @param name the name of the container registry. + */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name of the container registry. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container registry. + * + * @param name the name value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @param type the type value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryNameStatus.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryNameStatus.java new file mode 100644 index 0000000000000..5326700abe153 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryNameStatus.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.RegistryNameStatusInner; + +/** + * Type representing RegistryNameStatus. + */ +public interface RegistryNameStatus extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryPassword.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryPassword.java new file mode 100644 index 0000000000000..43d1ff14b8935 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryPassword.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The login password for the container registry. + */ +public class RegistryPassword { + /** + * The password name. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /** + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the password name. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the password name. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Get the password value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the password value. + * + * @param value the value value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUpdateParameters.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUpdateParameters.java new file mode 100644 index 0000000000000..83d5f1e54d993 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUpdateParameters.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a container registry. + */ +@JsonFlatten +public class RegistryUpdateParameters { + /** + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The parameters of a storage account for the container registry. Only + * applicable to Basic SKU. If specified, the storage account must be in + * the same physical location as the container registry. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the tags for the container registry. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the container registry. + * + * @param tags the tags value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the parameters of a storage account for the container registry. Only applicable to Basic SKU. If specified, the storage account must be in the same physical location as the container registry. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the parameters of a storage account for the container registry. Only applicable to Basic SKU. If specified, the storage account must be in the same physical location as the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsage.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsage.java new file mode 100644 index 0000000000000..88f492ccdde7c --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota usage for a container registry. + */ +public class RegistryUsage { + /** + * The name of the usage. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The limit of the usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /** + * The unit of measurement. Possible values include: 'Count', 'Bytes'. + */ + @JsonProperty(value = "unit") + private RegistryUsageUnit unit; + + /** + * Get the name of the usage. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the usage. + * + * @param name the name value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withName(String name) { + this.name = name; + return this; + } + + /** + * Get the limit of the usage. + * + * @return the limit value + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit of the usage. + * + * @param limit the limit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the usage. + * + * @param currentValue the currentValue value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @return the unit value + */ + public RegistryUsageUnit unit() { + return this.unit; + } + + /** + * Set the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @param unit the unit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withUnit(RegistryUsageUnit unit) { + this.unit = unit; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsageListResult.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsageListResult.java new file mode 100644 index 0000000000000..8a4c618ea7f5e --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.RegistryUsageListResultInner; +import java.util.List; + +/** + * Type representing RegistryUsageListResult. + */ +public interface RegistryUsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsageUnit.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsageUnit.java new file mode 100644 index 0000000000000..ede60a09a41cc --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/RegistryUsageUnit.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RegistryUsageUnit. + */ +public final class RegistryUsageUnit extends ExpandableStringEnum { + /** Static value Count for RegistryUsageUnit. */ + public static final RegistryUsageUnit COUNT = fromString("Count"); + + /** Static value Bytes for RegistryUsageUnit. */ + public static final RegistryUsageUnit BYTES = fromString("Bytes"); + + /** + * Creates or finds a RegistryUsageUnit from its string representation. + * @param name a name to look for + * @return the corresponding RegistryUsageUnit + */ + @JsonCreator + public static RegistryUsageUnit fromString(String name) { + return fromString(name, RegistryUsageUnit.class); + } + + /** + * @return known RegistryUsageUnit values + */ + public static Collection values() { + return values(RegistryUsageUnit.class); + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Replication.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Replication.java new file mode 100644 index 0000000000000..76c0ca4988c44 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Replication.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ReplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; + +/** + * Type representing Replication. + */ +public interface Replication extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Replication definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of Replication definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Replication definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the replication definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + */ + WithLocation withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the replication definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the replication definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTags { + } + } + /** + * The template for a Replication update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTags { + } + + /** + * Grouping of Replication update stages. + */ + interface UpdateStages { + /** + * The stage of the replication update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/ReplicationUpdateParameters.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/ReplicationUpdateParameters.java new file mode 100644 index 0000000000000..8c9160a484f3e --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/ReplicationUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for updating a replication. + */ +public class ReplicationUpdateParameters { + /** + * The tags for the replication. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags for the replication. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the replication. + * + * @param tags the tags value to set + * @return the ReplicationUpdateParameters object itself. + */ + public ReplicationUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Replications.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Replications.java new file mode 100644 index 0000000000000..bc271b4f7e4a0 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Replications.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ReplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Replications. + */ +public interface Replications extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String replicationName); + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String replicationName); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Request.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Request.java new file mode 100644 index 0000000000000..2f196834c3f2e --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Request.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request that generated the event. + */ +public class Request { + /** + * The ID of the request that initiated the event. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The IP or hostname and possibly port of the client connection that + * initiated the event. This is the RemoteAddr from the standard http + * request. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The externally accessible hostname of the registry instance, as + * specified by the http host header on incoming requests. + */ + @JsonProperty(value = "host") + private String host; + + /** + * The request method that generated the event. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The user agent header of the request. + */ + @JsonProperty(value = "useragent") + private String useragent; + + /** + * Get the ID of the request that initiated the event. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the request that initiated the event. + * + * @param id the id value to set + * @return the Request object itself. + */ + public Request withId(String id) { + this.id = id; + return this; + } + + /** + * Get the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @param addr the addr value to set + * @return the Request object itself. + */ + public Request withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @param host the host value to set + * @return the Request object itself. + */ + public Request withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the request method that generated the event. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the request method that generated the event. + * + * @param method the method value to set + * @return the Request object itself. + */ + public Request withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the user agent header of the request. + * + * @return the useragent value + */ + public String useragent() { + return this.useragent; + } + + /** + * Set the user agent header of the request. + * + * @param useragent the useragent value to set + * @return the Request object itself. + */ + public Request withUseragent(String useragent) { + this.useragent = useragent; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Sku.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Sku.java new file mode 100644 index 0000000000000..4e52867ba2ae0 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Sku.java @@ -0,0 +1,61 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of a container registry. + */ +public class Sku { + /** + * The SKU name of the container registry. Required for registry creation. + * Possible values include: 'Basic', 'Managed_Basic', 'Managed_Standard', + * 'Managed_Premium'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The SKU tier based on the SKU name. Possible values include: 'Basic', + * 'Managed'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the SKU name of the container registry. Required for registry creation. Possible values include: 'Basic', 'Managed_Basic', 'Managed_Standard', 'Managed_Premium'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set the SKU name of the container registry. Required for registry creation. Possible values include: 'Basic', 'Managed_Basic', 'Managed_Standard', 'Managed_Premium'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the SKU tier based on the SKU name. Possible values include: 'Basic', 'Managed'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/SkuName.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/SkuName.java new file mode 100644 index 0000000000000..8a8fbb1e586cd --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/SkuName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Managed_Basic for SkuName. */ + public static final SkuName MANAGED_BASIC = fromString("Managed_Basic"); + + /** Static value Managed_Standard for SkuName. */ + public static final SkuName MANAGED_STANDARD = fromString("Managed_Standard"); + + /** Static value Managed_Premium for SkuName. */ + public static final SkuName MANAGED_PREMIUM = fromString("Managed_Premium"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/SkuTier.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/SkuTier.java new file mode 100644 index 0000000000000..e9065a0c587d0 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/SkuTier.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.v2017_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Managed for SkuTier. */ + public static final SkuTier MANAGED = fromString("Managed"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Source.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Source.java new file mode 100644 index 0000000000000..b658eba08fced --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Source.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The registry node that generated the event. Put differently, while the actor + * initiates the event, the source generates it. + */ +public class Source { + /** + * The IP or hostname and the port of the registry node that generated the + * event. Generally, this will be resolved by os.Hostname() along with the + * running port. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The running instance of an application. Changes after each restart. + */ + @JsonProperty(value = "instanceID") + private String instanceID; + + /** + * Get the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @param addr the addr value to set + * @return the Source object itself. + */ + public Source withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the running instance of an application. Changes after each restart. + * + * @return the instanceID value + */ + public String instanceID() { + return this.instanceID; + } + + /** + * Set the running instance of an application. Changes after each restart. + * + * @param instanceID the instanceID value to set + * @return the Source object itself. + */ + public Source withInstanceID(String instanceID) { + this.instanceID = instanceID; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Status.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Status.java new file mode 100644 index 0000000000000..fc60cbace94f9 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Status.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The status of an Azure resource at the time the operation was called. + */ +public class Status { + /** + * The short label for the status. + */ + @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) + private String displayStatus; + + /** + * The detailed message for the status, including alerts and error + * messages. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The timestamp when the status was changed to the current value. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Get the short label for the status. + * + * @return the displayStatus value + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the detailed message for the status, including alerts and error messages. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the timestamp when the status was changed to the current value. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/StorageAccountProperties.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/StorageAccountProperties.java new file mode 100644 index 0000000000000..7ce1619e3e18f --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/StorageAccountProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a storage account for a container registry. Only + * applicable to Basic SKU. + */ +public class StorageAccountProperties { + /** + * The resource ID of the storage account. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the resource ID of the storage account. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the storage account. + * + * @param id the id value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Target.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Target.java new file mode 100644 index 0000000000000..c3a24974a135f --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Target.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The target of the event. + */ +public class Target { + /** + * The MIME type of the referenced object. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /** + * The number of bytes of the content. Same as Length field. + */ + @JsonProperty(value = "size") + private Long size; + + /** + * The digest of the content, as defined by the Registry V2 HTTP API + * Specificiation. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * The number of bytes of the content. Same as Size field. + */ + @JsonProperty(value = "length") + private Long length; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The direct URL to the content. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get the MIME type of the referenced object. + * + * @return the mediaType value + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the MIME type of the referenced object. + * + * @param mediaType the mediaType value to set + * @return the Target object itself. + */ + public Target withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the number of bytes of the content. Same as Length field. + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Set the number of bytes of the content. Same as Length field. + * + * @param size the size value to set + * @return the Target object itself. + */ + public Target withSize(Long size) { + this.size = size; + return this; + } + + /** + * Get the digest of the content, as defined by the Registry V2 HTTP API Specificiation. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest of the content, as defined by the Registry V2 HTTP API Specificiation. + * + * @param digest the digest value to set + * @return the Target object itself. + */ + public Target withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Get the number of bytes of the content. Same as Size field. + * + * @return the length value + */ + public Long length() { + return this.length; + } + + /** + * Set the number of bytes of the content. Same as Size field. + * + * @param length the length value to set + * @return the Target object itself. + */ + public Target withLength(Long length) { + this.length = length; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the Target object itself. + */ + public Target withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the direct URL to the content. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the direct URL to the content. + * + * @param url the url value to set + * @return the Target object itself. + */ + public Target withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the Target object itself. + */ + public Target withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Webhook.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Webhook.java new file mode 100644 index 0000000000000..45f8ff5f1a7f3 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Webhook.java @@ -0,0 +1,247 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.WebhookInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing Webhook. + */ +public interface Webhook extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the status value. + */ + WebhookStatus status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Webhook definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithActions, DefinitionStages.WithLocation, DefinitionStages.WithServiceUri, DefinitionStages.WithCreate { + } + + /** + * Grouping of Webhook definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Webhook definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the webhook definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + */ + WithActions withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the webhook definition allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + */ + WithLocation withActions(List actions); + } + + /** + * The stage of the webhook definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithServiceUri withLocation(String location); + } + + /** + * The stage of the webhook definition allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + */ + WithCreate withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook definition allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + */ + WithCreate withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the webhook definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + */ + WithCreate withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCustomHeaders, DefinitionStages.WithScope, DefinitionStages.WithStatus, DefinitionStages.WithTags { + } + } + /** + * The template for a Webhook update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithActions, UpdateStages.WithCustomHeaders, UpdateStages.WithScope, UpdateStages.WithServiceUri, UpdateStages.WithStatus, UpdateStages.WithTags { + } + + /** + * Grouping of Webhook update stages. + */ + interface UpdateStages { + /** + * The stage of the webhook update allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + */ + Update withActions(List actions); + } + + /** + * The stage of the webhook update allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + */ + Update withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook update allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + */ + Update withScope(String scope); + } + + /** + * The stage of the webhook update allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + */ + Update withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + */ + Update withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookAction.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookAction.java new file mode 100644 index 0000000000000..cb7398187a95d --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookAction.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.v2017_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookAction. + */ +public final class WebhookAction extends ExpandableStringEnum { + /** Static value push for WebhookAction. */ + public static final WebhookAction PUSH = fromString("push"); + + /** Static value delete for WebhookAction. */ + public static final WebhookAction DELETE = fromString("delete"); + + /** + * Creates or finds a WebhookAction from its string representation. + * @param name a name to look for + * @return the corresponding WebhookAction + */ + @JsonCreator + public static WebhookAction fromString(String name) { + return fromString(name, WebhookAction.class); + } + + /** + * @return known WebhookAction values + */ + public static Collection values() { + return values(WebhookAction.class); + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookCreateParameters.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookCreateParameters.java new file mode 100644 index 0000000000000..2ee802700339a --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookCreateParameters.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for creating a webhook. + */ +@JsonFlatten +public class WebhookCreateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The location of the webhook. This cannot be changed after the resource + * is created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location of the webhook. This cannot be changed after the resource is created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the webhook. This cannot be changed after the resource is created. + * + * @param location the location value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookStatus.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookStatus.java new file mode 100644 index 0000000000000..7eaec9ce24b41 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookStatus. + */ +public final class WebhookStatus extends ExpandableStringEnum { + /** Static value enabled for WebhookStatus. */ + public static final WebhookStatus ENABLED = fromString("enabled"); + + /** Static value disabled for WebhookStatus. */ + public static final WebhookStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a WebhookStatus from its string representation. + * @param name a name to look for + * @return the corresponding WebhookStatus + */ + @JsonCreator + public static WebhookStatus fromString(String name) { + return fromString(name, WebhookStatus.class); + } + + /** + * @return known WebhookStatus values + */ + public static Collection values() { + return values(WebhookStatus.class); + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookUpdateParameters.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookUpdateParameters.java new file mode 100644 index 0000000000000..f0e4f2746f329 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/WebhookUpdateParameters.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a webhook. + */ +@JsonFlatten +public class WebhookUpdateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri") + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Webhooks.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Webhooks.java new file mode 100644 index 0000000000000..f49a999d32e29 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/Webhooks.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation.WebhooksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Webhooks. + */ +public interface Webhooks extends SupportsCreating, HasInner { + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable pingAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String webhookName); + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/CallbackConfigImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/CallbackConfigImpl.java new file mode 100644 index 0000000000000..073c7fbb2914a --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/CallbackConfigImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.CallbackConfig; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class CallbackConfigImpl extends WrapperImpl implements CallbackConfig { + private final ContainerRegistryManager manager; + CallbackConfigImpl(CallbackConfigInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Map customHeaders() { + return this.inner().customHeaders(); + } + + @Override + public String serviceUri() { + return this.inner().serviceUri(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/CallbackConfigInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/CallbackConfigInner.java new file mode 100644 index 0000000000000..78b6445482a49 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/CallbackConfigInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration of service URI and custom headers for the webhook. + */ +public class CallbackConfigInner { + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + private Map customHeaders; + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 0000000000000..bbf7282c7d139 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManagementClientImpl.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.v2017_06_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerRegistryManagementClientImpl class. + */ +public class ContainerRegistryManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The 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; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The RegistriesInner object to access its operations. + */ + private RegistriesInner registries; + + /** + * Gets the RegistriesInner object to access its operations. + * @return the RegistriesInner object. + */ + public RegistriesInner registries() { + return this.registries; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ReplicationsInner object to access its operations. + */ + private ReplicationsInner replications; + + /** + * Gets the ReplicationsInner object to access its operations. + * @return the ReplicationsInner object. + */ + public ReplicationsInner replications() { + return this.replications; + } + + /** + * The WebhooksInner object to access its operations. + */ + private WebhooksInner webhooks; + + /** + * Gets the WebhooksInner object to access its operations. + * @return the WebhooksInner object. + */ + public WebhooksInner webhooks() { + return this.webhooks; + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerRegistryManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-06-01-preview"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.registries = new RegistriesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.replications = new ReplicationsInner(restClient().retrofit(), this); + this.webhooks = new WebhooksInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2017-06-01-preview"); + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManager.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManager.java new file mode 100644 index 0000000000000..7afbb3ebc97f3 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ContainerRegistryManager.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Operations; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerRegistry resource management. + */ +public final class ContainerRegistryManager extends ManagerCore { + private Registries registries; + private Operations operations; + private Replications replications; + private Webhooks webhooks; + /** + * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerRegistryManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerRegistryManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerRegistryManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerRegistry management API entry points that work across subscriptions + */ + ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(this); + } + return this.registries; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Replications. + */ + public Replications replications() { + if (this.replications == null) { + this.replications = new ReplicationsImpl(this); + } + return this.replications; + } + + /** + * @return Entry point to manage Webhooks. + */ + public Webhooks webhooks() { + if (this.webhooks == null) { + this.webhooks = new WebhooksImpl(this); + } + return this.webhooks; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerRegistryManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerRegistryManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerRegistryManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventImpl.java new file mode 100644 index 0000000000000..8d3929d487d25 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Event; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.EventResponseMessage; + +class EventImpl extends WrapperImpl implements Event { + private final ContainerRegistryManager manager; + EventImpl(EventInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public EventRequestMessage eventRequestMessage() { + return this.inner().eventRequestMessage(); + } + + @Override + public EventResponseMessage eventResponseMessage() { + return this.inner().eventResponseMessage(); + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInfoImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInfoImpl.java new file mode 100644 index 0000000000000..1bb14bf94beb3 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInfoImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.EventInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EventInfoImpl extends WrapperImpl implements EventInfo { + private final ContainerRegistryManager manager; + EventInfoImpl(EventInfoInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInfoInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInfoInner.java new file mode 100644 index 0000000000000..4a1bf70760237 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInfoInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The basic information of an event. + */ +public class EventInfoInner { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventInfoInner object itself. + */ + public EventInfoInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInner.java new file mode 100644 index 0000000000000..370ca799f2e5b --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/EventInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.EventResponseMessage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event for a webhook. + */ +public class EventInner extends EventInfoInner { + /** + * The event request message sent to the service URI. + */ + @JsonProperty(value = "eventRequestMessage") + private EventRequestMessage eventRequestMessage; + + /** + * The event response message received from the service URI. + */ + @JsonProperty(value = "eventResponseMessage") + private EventResponseMessage eventResponseMessage; + + /** + * Get the event request message sent to the service URI. + * + * @return the eventRequestMessage value + */ + public EventRequestMessage eventRequestMessage() { + return this.eventRequestMessage; + } + + /** + * Set the event request message sent to the service URI. + * + * @param eventRequestMessage the eventRequestMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventRequestMessage(EventRequestMessage eventRequestMessage) { + this.eventRequestMessage = eventRequestMessage; + return this; + } + + /** + * Get the event response message received from the service URI. + * + * @return the eventResponseMessage value + */ + public EventResponseMessage eventResponseMessage() { + return this.eventResponseMessage; + } + + /** + * Set the event response message received from the service URI. + * + * @param eventResponseMessage the eventResponseMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventResponseMessage(EventResponseMessage eventResponseMessage) { + this.eventResponseMessage = eventResponseMessage; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/IdParsingUtils.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..7ab63957ee40e --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationDefinitionImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationDefinitionImpl.java new file mode 100644 index 0000000000000..b17856801e7f6 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationDefinitionImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.OperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.OperationDisplayDefinition; + +class OperationDefinitionImpl extends WrapperImpl implements OperationDefinition { + private final ContainerRegistryManager manager; + OperationDefinitionImpl(OperationDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public OperationDisplayDefinition display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationDefinitionInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationDefinitionInner.java new file mode 100644 index 0000000000000..e85c263a95167 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationDefinitionInner.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.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.OperationDisplayDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a container registry operation. + */ +public class OperationDefinitionInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information for the container registry operation. + * + * @return the display value + */ + public OperationDisplayDefinition display() { + return this.display; + } + + /** + * Set the display information for the container registry operation. + * + * @param display the display value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { + this.display = display; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationsImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..afb94d9e7ed74 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.OperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerRegistryManager manager; + + OperationsImpl(ContainerRegistryManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationDefinition call(OperationDefinitionInner inner) { + return new OperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationsInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..fa2deacfadcfb --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerRegistry/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/PageImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..2b991ab22d859 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..bf47a2f238e1a --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesImpl.java @@ -0,0 +1,190 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registry; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryListCredentialsResult; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryNameStatus; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.PasswordName; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryUsageListResult; + +class RegistriesImpl extends GroupableResourcesCoreImpl implements Registries { + protected RegistriesImpl(ContainerRegistryManager manager) { + super(manager.inner().registries(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RegistriesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RegistriesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RegistriesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RegistriesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RegistryImpl define(String name) { + return wrapModel(name); + } + + @Override + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listCredentialsAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + RegistriesInner client = this.inner(); + return client.regenerateCredentialAsync(resourceGroupName, registryName, name) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + RegistriesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public RegistryNameStatus call(RegistryNameStatusInner inner) { + return new RegistryNameStatusImpl(inner, manager()); + } + }); + } + + @Override + protected RegistryImpl wrapModel(RegistryInner inner) { + return new RegistryImpl(inner.name(), inner, manager()); + } + + @Override + protected RegistryImpl wrapModel(String name) { + return new RegistryImpl(name, new RegistryInner(), this.manager()); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryUsageListResult call(RegistryUsageListResultInner inner) { + return new RegistryUsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesInner.java new file mode 100644 index 0000000000000..91a503dc9c8f8 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistriesInner.java @@ -0,0 +1,1512 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.PasswordName; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegenerateCredentialParameters; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryNameCheckRequest; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Registries. + */ +public class RegistriesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RegistriesService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RegistriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Registries to be + * used by Retrofit to perform actually REST calls. + */ + interface RegistriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegistryNameCheckRequest registryNameCheckRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries listCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials") + Observable> listCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries regenerateCredential" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential") + Observable> regenerateCredential(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateCredentialParameters regenerateCredentialParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registries listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryNameStatusInner object if successful. + */ + public RegistryNameStatusInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, RegistryNameStatusInner>() { + @Override + public RegistryNameStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (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."); + } + RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); + registryNameCheckRequest.withName(name); + 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) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().last().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginCreate(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().single().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().last().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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()); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner update(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginUpdate(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listCredentialsAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCredentialsWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> listCredentialsWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = listCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner regenerateCredential(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).toBlocking().single().body(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name), serviceCallback); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> regenerateCredentialWithServiceResponseAsync(String resourceGroupName, String registryName, PasswordName name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateCredentialDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateCredentialDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryUsageListResultInner object if successful. + */ + public RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listUsagesAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryUsageListResultInner object + */ + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryUsageListResultInner>() { + @Override + public RegistryUsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryUsageListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..29a65770a8e1c --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryImpl.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Registry; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Status; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.StorageAccountProperties; +import rx.functions.Func1; + +class RegistryImpl extends GroupableResourceCoreImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryUpdateParameters updateParameter; + RegistryImpl(String name, RegistryInner inner, ContainerRegistryManager manager) { + super(name, inner, manager); + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Boolean adminUserEnabled() { + return this.inner().adminUserEnabled(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String loginServer() { + return this.inner().loginServer(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public StorageAccountProperties storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public RegistryImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.inner().withAdminUserEnabled(adminUserEnabled); + } else { + this.updateParameter.withAdminUserEnabled(adminUserEnabled); + } + return this; + } + + @Override + public RegistryImpl withStorageAccount(StorageAccountProperties storageAccount) { + if (isInCreateMode()) { + this.inner().withStorageAccount(storageAccount); + } else { + this.updateParameter.withStorageAccount(storageAccount); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryInner.java new file mode 100644 index 0000000000000..ff36ccd8a3c93 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryInner.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Status; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.StorageAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a container registry. + */ +@JsonFlatten +public class RegistryInner extends Resource { + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "properties.loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /** + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The provisioning state of the container registry at the time the + * operation was called. Possible values include: 'Creating', 'Updating', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the container registry at the time the operation was + * called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The properties of the storage account for the container registry. Only + * applicable to Basic SKU. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the URL that can be used to log into the container registry. + * + * @return the loginServer value + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creation date of the container registry in ISO8601 format. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the container registry at the time the operation was called. + * + * @return the status value + */ + public Status status() { + return this.status; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the properties of the storage account for the container registry. Only applicable to Basic SKU. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the properties of the storage account for the container registry. Only applicable to Basic SKU. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryListCredentialsResultImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryListCredentialsResultImpl.java new file mode 100644 index 0000000000000..7e816b2fc06eb --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryListCredentialsResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryListCredentialsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryPassword; + +class RegistryListCredentialsResultImpl extends WrapperImpl implements RegistryListCredentialsResult { + private final ContainerRegistryManager manager; + RegistryListCredentialsResultImpl(RegistryListCredentialsResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List passwords() { + return this.inner().passwords(); + } + + @Override + public String username() { + return this.inner().username(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryListCredentialsResultInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryListCredentialsResultInner.java new file mode 100644 index 0000000000000..18a2c9a8362b2 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryListCredentialsResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListCredentials operation. + */ +public class RegistryListCredentialsResultInner { + /** + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username for a container registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for a container registry. + * + * @param username the username value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the list of passwords for a container registry. + * + * @return the passwords value + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the list of passwords for a container registry. + * + * @param passwords the passwords value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryNameStatusImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryNameStatusImpl.java new file mode 100644 index 0000000000000..702afe8cabea8 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryNameStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryNameStatusImpl extends WrapperImpl implements RegistryNameStatus { + private final ContainerRegistryManager manager; + RegistryNameStatusImpl(RegistryNameStatusInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryNameStatusInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryNameStatusInner.java new file mode 100644 index 0000000000000..7d6b4a04d3334 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryNameStatusInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to check the availability of a container registry + * name. + */ +public class RegistryNameStatusInner { + /** + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value that indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the value that indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get if any, the reason that the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set if any, the reason that the name is not available. + * + * @param reason the reason value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get if any, the error message that provides more detail for the reason that the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if any, the error message that provides more detail for the reason that the name is not available. + * + * @param message the message value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryUsageListResultImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryUsageListResultImpl.java new file mode 100644 index 0000000000000..32b666ba7beb4 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryUsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryUsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryUsage; + +class RegistryUsageListResultImpl extends WrapperImpl implements RegistryUsageListResult { + private final ContainerRegistryManager manager; + RegistryUsageListResultImpl(RegistryUsageListResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryUsageListResultInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryUsageListResultInner.java new file mode 100644 index 0000000000000..b997bd202b5b9 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/RegistryUsageListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.RegistryUsage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to get container registry quota usages. + */ +public class RegistryUsageListResultInner { + /** + * The list of container registry quota usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of container registry quota usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of container registry quota usages. + * + * @param value the value value to set + * @return the RegistryUsageListResultInner object itself. + */ + public RegistryUsageListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationImpl.java new file mode 100644 index 0000000000000..3d0a0a170ae92 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replication; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Status; + +class ReplicationImpl extends CreatableUpdatableImpl implements Replication, Replication.Definition, Replication.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String replicationName; + + ReplicationImpl(String name, ContainerRegistryManager manager) { + super(name, new ReplicationInner()); + this.manager = manager; + // Set resource name + this.replicationName = name; + // + } + + ReplicationImpl(ReplicationInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.replicationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.replicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "replications"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.getAsync(this.resourceGroupName, this.registryName, this.replicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ReplicationImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public ReplicationImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ReplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationInner.java new file mode 100644 index 0000000000000..9506108adfa5f --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationInner.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a replication for a container registry. + */ +@JsonFlatten +public class ReplicationInner extends Resource { + /** + * The provisioning state of the replication at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the replication at the time the operation was called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /** + * Get the provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the replication at the time the operation was called. + * + * @return the status value + */ + public Status status() { + return this.status; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsImpl.java new file mode 100644 index 0000000000000..e79a4505bc134 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replication; + +class ReplicationsImpl extends WrapperImpl implements Replications { + private final ContainerRegistryManager manager; + + ReplicationsImpl(ContainerRegistryManager manager) { + super(manager.inner().replications()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public ReplicationImpl define(String name) { + return wrapModel(name); + } + + private ReplicationImpl wrapModel(ReplicationInner inner) { + return new ReplicationImpl(inner, manager()); + } + + private ReplicationImpl wrapModel(String name) { + return new ReplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + ReplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, replicationName) + .map(new Func1() { + @Override + public Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, replicationName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java new file mode 100644 index 0000000000000..86ac2c3d830fa --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/ReplicationsInner.java @@ -0,0 +1,1138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.ReplicationUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Replications. + */ +public class ReplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ReplicationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReplicationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(ReplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Replications to be + * used by Retrofit to perform actually REST calls. + */ + interface ReplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Replications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner get(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner create(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().last().body(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginCreate(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().single().body(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String replicationName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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()); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String replicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String replicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().last().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + 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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().single().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ReplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ReplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhookImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhookImpl.java new file mode 100644 index 0000000000000..6e92862076ada --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhookImpl.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhook; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.WebhookUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.WebhookStatus; +import rx.functions.Func1; + +class WebhookImpl extends CreatableUpdatableImpl implements Webhook, Webhook.Definition, Webhook.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String webhookName; + private WebhookCreateParameters createParameter; + private WebhookUpdateParameters updateParameter; + + WebhookImpl(String name, ContainerRegistryManager manager) { + super(name, new WebhookInner()); + this.manager = manager; + // Set resource name + this.webhookName = name; + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + WebhookImpl(WebhookInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.webhookName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.webhookName = IdParsingUtils.getValueFromIdByName(inner.id(), "webhooks"); + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.createAsync(this.resourceGroupName, this.registryName, this.webhookName, this.createParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.webhookName, this.updateParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.getAsync(this.resourceGroupName, this.registryName, this.webhookName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public WebhookStatus status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WebhookImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public WebhookImpl withLocation(String location) { + this.createParameter.withLocation(location); + return this; + } + + @Override + public WebhookImpl withActions(List actions) { + if (isInCreateMode()) { + this.createParameter.withActions(actions); + } else { + this.updateParameter.withActions(actions); + } + return this; + } + + @Override + public WebhookImpl withServiceUri(String serviceUri) { + if (isInCreateMode()) { + this.createParameter.withServiceUri(serviceUri); + } else { + this.updateParameter.withServiceUri(serviceUri); + } + return this; + } + + @Override + public WebhookImpl withCustomHeaders(Map customHeaders) { + if (isInCreateMode()) { + this.createParameter.withCustomHeaders(customHeaders); + } else { + this.updateParameter.withCustomHeaders(customHeaders); + } + return this; + } + + @Override + public WebhookImpl withScope(String scope) { + if (isInCreateMode()) { + this.createParameter.withScope(scope); + } else { + this.updateParameter.withScope(scope); + } + return this; + } + + @Override + public WebhookImpl withStatus(WebhookStatus status) { + if (isInCreateMode()) { + this.createParameter.withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + + @Override + public WebhookImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameter.withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhookInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhookInner.java new file mode 100644 index 0000000000000..cdda495a1a3e8 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhookInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.WebhookStatus; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a webhook for a container registry. + */ +@JsonFlatten +public class WebhookInner extends Resource { + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * The provisioning state of the webhook at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the provisioning state of the webhook at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhooksImpl.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhooksImpl.java new file mode 100644 index 0000000000000..6260a05f972a6 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhooksImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.EventInfo; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.CallbackConfig; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Event; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhook; + +class WebhooksImpl extends WrapperImpl implements Webhooks { + private final ContainerRegistryManager manager; + + WebhooksImpl(ContainerRegistryManager manager) { + super(manager.inner().webhooks()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public WebhookImpl define(String name) { + return wrapModel(name); + } + + private WebhookImpl wrapModel(WebhookInner inner) { + return new WebhookImpl(inner, manager()); + } + + private WebhookImpl wrapModel(String name) { + return new WebhookImpl(name, this.manager()); + } + + @Override + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.pingAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public EventInfo call(EventInfoInner inner) { + return new EventInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getCallbackConfigAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public CallbackConfig call(CallbackConfigInner inner) { + return new CallbackConfigImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + WebhooksInner client = this.inner(); + return client.listEventsAsync(resourceGroupName, registryName, webhookName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Event call(EventInner inner) { + return new EventImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + WebhooksInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, webhookName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhooksInner.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhooksInner.java new file mode 100644 index 0000000000000..31ab4c5bb5762 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/WebhooksInner.java @@ -0,0 +1,1418 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2017_06_01_preview.WebhookUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Webhooks. + */ +public class WebhooksInner { + /** The Retrofit service to perform REST calls. */ + private WebhooksService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of WebhooksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebhooksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(WebhooksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Webhooks to be + * used by Retrofit to perform actually REST calls. + */ + interface WebhooksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks ping" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping") + Observable> ping(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks getCallbackConfig" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig") + Observable> getCallbackConfig(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks listEvents" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents") + Observable> listEvents(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_06_01_preview.Webhooks listEventsNext" }) + @GET + Observable> listEventsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner get(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner create(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginCreate(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String webhookName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().last().body(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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()); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String webhookName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String webhookName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner update(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginUpdate(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebhookInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventInfoInner object if successful. + */ + public EventInfoInner ping(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture pingAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, EventInfoInner>() { + @Override + public EventInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable> pingWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = pingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse pingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CallbackConfigInner object if successful. + */ + public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, CallbackConfigInner>() { + @Override + public CallbackConfigInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable> getCallbackConfigWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getCallbackConfigDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCallbackConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEvents(final String resourceGroupName, final String registryName, final String webhookName) { + ServiceResponse> response = listEventsSinglePageAsync(resourceGroupName, registryName, webhookName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsSinglePageAsync(resourceGroupName, registryName, webhookName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsWithServiceResponseAsync(resourceGroupName, registryName, webhookName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsSinglePageAsync(resourceGroupName, registryName, webhookName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + ServiceResponse> * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsSinglePageAsync(final String resourceGroupName, final String registryName, final String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listEventsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebhookInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEventsNext(final String nextPageLink) { + ServiceResponse> response = listEventsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsNextAsync(final String nextPageLink) { + return listEventsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsNextWithServiceResponseAsync(final String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listEventsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/package-info.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..8c43daff60df1 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview.implementation; diff --git a/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/package-info.java b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/package-info.java new file mode 100644 index 0000000000000..2ad9a6d61a081 --- /dev/null +++ b/containerregistry/resource-manager/v2017_06_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2017_06_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2017_06_01_preview; diff --git a/containerregistry/resource-manager/v2017_10_01/pom.xml b/containerregistry/resource-manager/v2017_10_01/pom.xml new file mode 100644 index 0000000000000..730279dc810fe --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerregistry.v2017_10_01 + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Actor.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Actor.java new file mode 100644 index 0000000000000..ca47b5f6e10ae --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Actor.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The agent that initiated the event. For most situations, this could be from + * the authorization context of the request. + */ +public class Actor { + /** + * The subject or username associated with the request context that + * generated the event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the subject or username associated with the request context that generated the event. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the subject or username associated with the request context that generated the event. + * + * @param name the name value to set + * @return the Actor object itself. + */ + public Actor withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/CallbackConfig.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/CallbackConfig.java new file mode 100644 index 0000000000000..f486c85e65252 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/CallbackConfig.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.CallbackConfigInner; +import java.util.Map; + +/** + * Type representing CallbackConfig. + */ +public interface CallbackConfig extends HasInner, HasManager { + /** + * @return the customHeaders value. + */ + Map customHeaders(); + + /** + * @return the serviceUri value. + */ + String serviceUri(); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Event.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Event.java new file mode 100644 index 0000000000000..e1f12638418ff --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Event.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.EventInner; + +/** + * Type representing Event. + */ +public interface Event extends HasInner, HasManager { + /** + * @return the eventRequestMessage value. + */ + EventRequestMessage eventRequestMessage(); + + /** + * @return the eventResponseMessage value. + */ + EventResponseMessage eventResponseMessage(); + + /** + * @return the id value. + */ + String id(); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventContent.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventContent.java new file mode 100644 index 0000000000000..b03f6ac583ba1 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventContent.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The content of the event request message. + */ +public class EventContent { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The time at which the event occurred. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * The action that encompasses the provided event. + */ + @JsonProperty(value = "action") + private String action; + + /** + * The target of the event. + */ + @JsonProperty(value = "target") + private Target target; + + /** + * The request that generated the event. + */ + @JsonProperty(value = "request") + private Request request; + + /** + * The agent that initiated the event. For most situations, this could be + * from the authorization context of the request. + */ + @JsonProperty(value = "actor") + private Actor actor; + + /** + * The registry node that generated the event. Put differently, while the + * actor initiates the event, the source generates it. + */ + @JsonProperty(value = "source") + private Source source; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventContent object itself. + */ + public EventContent withId(String id) { + this.id = id; + return this; + } + + /** + * Get the time at which the event occurred. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the time at which the event occurred. + * + * @param timestamp the timestamp value to set + * @return the EventContent object itself. + */ + public EventContent withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the action that encompasses the provided event. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the action that encompasses the provided event. + * + * @param action the action value to set + * @return the EventContent object itself. + */ + public EventContent withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the target of the event. + * + * @return the target value + */ + public Target target() { + return this.target; + } + + /** + * Set the target of the event. + * + * @param target the target value to set + * @return the EventContent object itself. + */ + public EventContent withTarget(Target target) { + this.target = target; + return this; + } + + /** + * Get the request that generated the event. + * + * @return the request value + */ + public Request request() { + return this.request; + } + + /** + * Set the request that generated the event. + * + * @param request the request value to set + * @return the EventContent object itself. + */ + public EventContent withRequest(Request request) { + this.request = request; + return this; + } + + /** + * Get the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @return the actor value + */ + public Actor actor() { + return this.actor; + } + + /** + * Set the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @param actor the actor value to set + * @return the EventContent object itself. + */ + public EventContent withActor(Actor actor) { + this.actor = actor; + return this; + } + + /** + * Get the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @return the source value + */ + public Source source() { + return this.source; + } + + /** + * Set the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @param source the source value to set + * @return the EventContent object itself. + */ + public EventContent withSource(Source source) { + this.source = source; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventInfo.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventInfo.java new file mode 100644 index 0000000000000..1c6c2c6220050 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventInfo.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.EventInfoInner; + +/** + * Type representing EventInfo. + */ +public interface EventInfo extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventRequestMessage.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventRequestMessage.java new file mode 100644 index 0000000000000..6f1df693eb81c --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventRequestMessage.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event request message sent to the service URI. + */ +public class EventRequestMessage { + /** + * The content of the event request message. + */ + @JsonProperty(value = "content") + private EventContent content; + + /** + * The headers of the event request message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The HTTP method used to send the event request message. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The URI used to send the event request message. + */ + @JsonProperty(value = "requestUri") + private String requestUri; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event request message. + * + * @return the content value + */ + public EventContent content() { + return this.content; + } + + /** + * Set the content of the event request message. + * + * @param content the content value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withContent(EventContent content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event request message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event request message. + * + * @param headers the headers value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the HTTP method used to send the event request message. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the HTTP method used to send the event request message. + * + * @param method the method value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the URI used to send the event request message. + * + * @return the requestUri value + */ + public String requestUri() { + return this.requestUri; + } + + /** + * Set the URI used to send the event request message. + * + * @param requestUri the requestUri value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withRequestUri(String requestUri) { + this.requestUri = requestUri; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventResponseMessage.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventResponseMessage.java new file mode 100644 index 0000000000000..d204d50afd548 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/EventResponseMessage.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event response message received from the service URI. + */ +public class EventResponseMessage { + /** + * The content of the event response message. + */ + @JsonProperty(value = "content") + private String content; + + /** + * The headers of the event response message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The reason phrase of the event response message. + */ + @JsonProperty(value = "reasonPhrase") + private String reasonPhrase; + + /** + * The status code of the event response message. + */ + @JsonProperty(value = "statusCode") + private String statusCode; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event response message. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the event response message. + * + * @param content the content value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event response message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event response message. + * + * @param headers the headers value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the reason phrase of the event response message. + * + * @return the reasonPhrase value + */ + public String reasonPhrase() { + return this.reasonPhrase; + } + + /** + * Set the reason phrase of the event response message. + * + * @param reasonPhrase the reasonPhrase value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withReasonPhrase(String reasonPhrase) { + this.reasonPhrase = reasonPhrase; + return this; + } + + /** + * Get the status code of the event response message. + * + * @return the statusCode value + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the status code of the event response message. + * + * @param statusCode the statusCode value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportImageParameters.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportImageParameters.java new file mode 100644 index 0000000000000..95a030f6eb196 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportImageParameters.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportImageParameters model. + */ +public class ImportImageParameters { + /** + * The source of the image. + */ + @JsonProperty(value = "source", required = true) + private ImportSource source; + + /** + * List of strings of the form repo[:tag]. When tag is omitted the source + * will be used (or 'latest' if source tag is also omitted). + */ + @JsonProperty(value = "targetTags") + private List targetTags; + + /** + * List of strings of repository names to do a manifest only copy. No tag + * will be created. + */ + @JsonProperty(value = "untaggedTargetRepositories") + private List untaggedTargetRepositories; + + /** + * When Force, any existing target tags will be overwritten. When NoForce, + * any existing target tags will fail the operation before any copying + * begins. Possible values include: 'NoForce', 'Force'. + */ + @JsonProperty(value = "mode") + private ImportMode mode; + + /** + * Get the source of the image. + * + * @return the source value + */ + public ImportSource source() { + return this.source; + } + + /** + * Set the source of the image. + * + * @param source the source value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withSource(ImportSource source) { + this.source = source; + return this; + } + + /** + * Get list of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + * + * @return the targetTags value + */ + public List targetTags() { + return this.targetTags; + } + + /** + * Set list of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + * + * @param targetTags the targetTags value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withTargetTags(List targetTags) { + this.targetTags = targetTags; + return this; + } + + /** + * Get list of strings of repository names to do a manifest only copy. No tag will be created. + * + * @return the untaggedTargetRepositories value + */ + public List untaggedTargetRepositories() { + return this.untaggedTargetRepositories; + } + + /** + * Set list of strings of repository names to do a manifest only copy. No tag will be created. + * + * @param untaggedTargetRepositories the untaggedTargetRepositories value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withUntaggedTargetRepositories(List untaggedTargetRepositories) { + this.untaggedTargetRepositories = untaggedTargetRepositories; + return this; + } + + /** + * Get when Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'. + * + * @return the mode value + */ + public ImportMode mode() { + return this.mode; + } + + /** + * Set when Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'. + * + * @param mode the mode value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withMode(ImportMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportMode.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportMode.java new file mode 100644 index 0000000000000..7177127911da2 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/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.v2017_10_01; + +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/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportSource.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportSource.java new file mode 100644 index 0000000000000..969a1d6eac83e --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ImportSource.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +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 resource identifier of the target Azure Container Registry. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resource identifier of the target Azure Container Registry. + * + * @param resourceId the resourceId value to set + * @return the ImportSource object itself. + */ + public ImportSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @return the sourceImage value + */ + public String sourceImage() { + return this.sourceImage; + } + + /** + * Set repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @param sourceImage the sourceImage value to set + * @return the ImportSource object itself. + */ + public ImportSource withSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/OperationDefinition.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/OperationDefinition.java new file mode 100644 index 0000000000000..a533dcd1c98b4 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/OperationDefinition.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.OperationDefinitionInner; + +/** + * Type representing OperationDefinition. + */ +public interface OperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplayDefinition display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/OperationDisplayDefinition.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/OperationDisplayDefinition.java new file mode 100644 index 0000000000000..3715906016604 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/OperationDisplayDefinition.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a container registry operation. + */ +public class OperationDisplayDefinition { + /** + * The resource provider name: Microsoft.ContainerRegistry. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the resource provider name: Microsoft.ContainerRegistry. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the resource provider name: Microsoft.ContainerRegistry. + * + * @param provider the provider value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that users can perform. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that users can perform. + * + * @param operation the operation value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the operation. + * + * @param description the description value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Operations.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Operations.java new file mode 100644 index 0000000000000..d2ad7b2f427e0 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/PasswordName.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/PasswordName.java new file mode 100644 index 0000000000000..a9afa99cebcc5 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/PasswordName.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PasswordName. + */ +public enum PasswordName { + /** Enum value password. */ + PASSWORD("password"), + + /** Enum value password2. */ + PASSWORD2("password2"); + + /** The actual serialized value for a PasswordName instance. */ + private String value; + + PasswordName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PasswordName instance. + * + * @param value the serialized value to parse. + * @return the parsed PasswordName object, or null if unable to parse. + */ + @JsonCreator + public static PasswordName fromString(String value) { + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ProvisioningState.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ProvisioningState.java new file mode 100644 index 0000000000000..766c44953849c --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegenerateCredentialParameters.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegenerateCredentialParameters.java new file mode 100644 index 0000000000000..ff51f62f3e35f --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegenerateCredentialParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the login credential. + */ +public class RegenerateCredentialParameters { + /** + * Specifies name of the password which should be regenerated -- password + * or password2. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** + * Get specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegenerateCredentialParameters object itself. + */ + public RegenerateCredentialParameters withName(PasswordName name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Registries.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Registries.java new file mode 100644 index 0000000000000..0ffafb185ef1f --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Registries.java @@ -0,0 +1,77 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.RegistriesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Registries. + */ +public interface Registries extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCredentialsAsync(String resourceGroupName, String registryName); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String resourceGroupName, String registryName); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Registry.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Registry.java new file mode 100644 index 0000000000000..f19c543d453dd --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Registry.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.RegistryInner; + +/** + * Type representing Registry. + */ +public interface Registry extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the loginServer value. + */ + String loginServer(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the storageAccount value. + */ + StorageAccountProperties storageAccount(); + + /** + * The entirety of the Registry definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of Registry definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Registry definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Registry definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the registry definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the registry update allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry update allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + WithCreate withStorageAccount(StorageAccountProperties storageAccount); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdminUserEnabled, DefinitionStages.WithStorageAccount { + } + } + /** + * The template for a Registry update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdminUserEnabled, UpdateStages.WithSku, UpdateStages.WithStorageAccount { + } + + /** + * Grouping of Registry update stages. + */ + interface UpdateStages { + /** + * The stage of the registry {0} allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(Sku sku); + } + + /** + * The stage of the registry {0} allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + Update withStorageAccount(StorageAccountProperties storageAccount); + } + + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryListCredentialsResult.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryListCredentialsResult.java new file mode 100644 index 0000000000000..95a9052d40202 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryListCredentialsResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.RegistryListCredentialsResultInner; +import java.util.List; + +/** + * Type representing RegistryListCredentialsResult. + */ +public interface RegistryListCredentialsResult extends HasInner, HasManager { + /** + * @return the passwords value. + */ + List passwords(); + + /** + * @return the username value. + */ + String username(); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryNameCheckRequest.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryNameCheckRequest.java new file mode 100644 index 0000000000000..38e958269dae6 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryNameCheckRequest.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A request to check whether a container registry name is available. + */ +public class RegistryNameCheckRequest { + /** + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of RegistryNameCheckRequest class. + * @param name the name of the container registry. + */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name of the container registry. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container registry. + * + * @param name the name value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @param type the type value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryNameStatus.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryNameStatus.java new file mode 100644 index 0000000000000..6e283e3d47a21 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryNameStatus.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.RegistryNameStatusInner; + +/** + * Type representing RegistryNameStatus. + */ +public interface RegistryNameStatus extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryPassword.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryPassword.java new file mode 100644 index 0000000000000..c8bf3f02a3c12 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryPassword.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The login password for the container registry. + */ +public class RegistryPassword { + /** + * The password name. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /** + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the password name. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the password name. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Get the password value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the password value. + * + * @param value the value value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUpdateParameters.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUpdateParameters.java new file mode 100644 index 0000000000000..12dd3899d44b6 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUpdateParameters.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a container registry. + */ +@JsonFlatten +public class RegistryUpdateParameters { + /** + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The parameters of a storage account for the container registry. Only + * applicable to Classic SKU. If specified, the storage account must be in + * the same physical location as the container registry. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the tags for the container registry. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the container registry. + * + * @param tags the tags value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the parameters of a storage account for the container registry. Only applicable to Classic SKU. If specified, the storage account must be in the same physical location as the container registry. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the parameters of a storage account for the container registry. Only applicable to Classic SKU. If specified, the storage account must be in the same physical location as the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsage.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsage.java new file mode 100644 index 0000000000000..6d29799cd57f7 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota usage for a container registry. + */ +public class RegistryUsage { + /** + * The name of the usage. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The limit of the usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /** + * The unit of measurement. Possible values include: 'Count', 'Bytes'. + */ + @JsonProperty(value = "unit") + private RegistryUsageUnit unit; + + /** + * Get the name of the usage. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the usage. + * + * @param name the name value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withName(String name) { + this.name = name; + return this; + } + + /** + * Get the limit of the usage. + * + * @return the limit value + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit of the usage. + * + * @param limit the limit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the usage. + * + * @param currentValue the currentValue value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @return the unit value + */ + public RegistryUsageUnit unit() { + return this.unit; + } + + /** + * Set the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @param unit the unit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withUnit(RegistryUsageUnit unit) { + this.unit = unit; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsageListResult.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsageListResult.java new file mode 100644 index 0000000000000..94a36b31a2e7e --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.RegistryUsageListResultInner; +import java.util.List; + +/** + * Type representing RegistryUsageListResult. + */ +public interface RegistryUsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsageUnit.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsageUnit.java new file mode 100644 index 0000000000000..cf63d2a4cdcea --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/RegistryUsageUnit.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RegistryUsageUnit. + */ +public final class RegistryUsageUnit extends ExpandableStringEnum { + /** Static value Count for RegistryUsageUnit. */ + public static final RegistryUsageUnit COUNT = fromString("Count"); + + /** Static value Bytes for RegistryUsageUnit. */ + public static final RegistryUsageUnit BYTES = fromString("Bytes"); + + /** + * Creates or finds a RegistryUsageUnit from its string representation. + * @param name a name to look for + * @return the corresponding RegistryUsageUnit + */ + @JsonCreator + public static RegistryUsageUnit fromString(String name) { + return fromString(name, RegistryUsageUnit.class); + } + + /** + * @return known RegistryUsageUnit values + */ + public static Collection values() { + return values(RegistryUsageUnit.class); + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Replication.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Replication.java new file mode 100644 index 0000000000000..6e1d02151b02f --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Replication.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ReplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import java.util.Map; + +/** + * Type representing Replication. + */ +public interface Replication extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Replication definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of Replication definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Replication definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the replication definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + */ + WithLocation withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the replication definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the replication definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTags { + } + } + /** + * The template for a Replication update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTags { + } + + /** + * Grouping of Replication update stages. + */ + interface UpdateStages { + /** + * The stage of the replication update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ReplicationUpdateParameters.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ReplicationUpdateParameters.java new file mode 100644 index 0000000000000..ef447b41512ef --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/ReplicationUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for updating a replication. + */ +public class ReplicationUpdateParameters { + /** + * The tags for the replication. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags for the replication. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the replication. + * + * @param tags the tags value to set + * @return the ReplicationUpdateParameters object itself. + */ + public ReplicationUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Replications.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Replications.java new file mode 100644 index 0000000000000..a30bd37101ca8 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Replications.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ReplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Replications. + */ +public interface Replications extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String replicationName); + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String replicationName); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Request.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Request.java new file mode 100644 index 0000000000000..3afe648fcc70c --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Request.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request that generated the event. + */ +public class Request { + /** + * The ID of the request that initiated the event. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The IP or hostname and possibly port of the client connection that + * initiated the event. This is the RemoteAddr from the standard http + * request. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The externally accessible hostname of the registry instance, as + * specified by the http host header on incoming requests. + */ + @JsonProperty(value = "host") + private String host; + + /** + * The request method that generated the event. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The user agent header of the request. + */ + @JsonProperty(value = "useragent") + private String useragent; + + /** + * Get the ID of the request that initiated the event. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the request that initiated the event. + * + * @param id the id value to set + * @return the Request object itself. + */ + public Request withId(String id) { + this.id = id; + return this; + } + + /** + * Get the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @param addr the addr value to set + * @return the Request object itself. + */ + public Request withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @param host the host value to set + * @return the Request object itself. + */ + public Request withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the request method that generated the event. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the request method that generated the event. + * + * @param method the method value to set + * @return the Request object itself. + */ + public Request withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the user agent header of the request. + * + * @return the useragent value + */ + public String useragent() { + return this.useragent; + } + + /** + * Set the user agent header of the request. + * + * @param useragent the useragent value to set + * @return the Request object itself. + */ + public Request withUseragent(String useragent) { + this.useragent = useragent; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Sku.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Sku.java new file mode 100644 index 0000000000000..dc9a0404543d5 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Sku.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of a container registry. + */ +public class Sku { + /** + * The SKU name of the container registry. Required for registry creation. + * Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The SKU tier based on the SKU name. Possible values include: 'Classic', + * 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set the SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the SKU tier based on the SKU name. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/SkuName.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/SkuName.java new file mode 100644 index 0000000000000..f9aeb6ee9d65c --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/SkuName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Classic for SkuName. */ + public static final SkuName CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** Static value Premium for SkuName. */ + public static final SkuName PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/SkuTier.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/SkuTier.java new file mode 100644 index 0000000000000..979eb9fca6f64 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/SkuTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Classic for SkuTier. */ + public static final SkuTier CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for SkuTier. */ + public static final SkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Source.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Source.java new file mode 100644 index 0000000000000..cdea3d4a9792f --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Source.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The registry node that generated the event. Put differently, while the actor + * initiates the event, the source generates it. + */ +public class Source { + /** + * The IP or hostname and the port of the registry node that generated the + * event. Generally, this will be resolved by os.Hostname() along with the + * running port. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The running instance of an application. Changes after each restart. + */ + @JsonProperty(value = "instanceID") + private String instanceID; + + /** + * Get the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @param addr the addr value to set + * @return the Source object itself. + */ + public Source withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the running instance of an application. Changes after each restart. + * + * @return the instanceID value + */ + public String instanceID() { + return this.instanceID; + } + + /** + * Set the running instance of an application. Changes after each restart. + * + * @param instanceID the instanceID value to set + * @return the Source object itself. + */ + public Source withInstanceID(String instanceID) { + this.instanceID = instanceID; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Status.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Status.java new file mode 100644 index 0000000000000..a2c3e5f5f1a5e --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Status.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The status of an Azure resource at the time the operation was called. + */ +public class Status { + /** + * The short label for the status. + */ + @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) + private String displayStatus; + + /** + * The detailed message for the status, including alerts and error + * messages. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The timestamp when the status was changed to the current value. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Get the short label for the status. + * + * @return the displayStatus value + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the detailed message for the status, including alerts and error messages. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the timestamp when the status was changed to the current value. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/StorageAccountProperties.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/StorageAccountProperties.java new file mode 100644 index 0000000000000..4a3401d695b21 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/StorageAccountProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a storage account for a container registry. Only + * applicable to Classic SKU. + */ +public class StorageAccountProperties { + /** + * The resource ID of the storage account. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the resource ID of the storage account. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the storage account. + * + * @param id the id value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Target.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Target.java new file mode 100644 index 0000000000000..0bab8d225b3b3 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Target.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The target of the event. + */ +public class Target { + /** + * The MIME type of the referenced object. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /** + * The number of bytes of the content. Same as Length field. + */ + @JsonProperty(value = "size") + private Long size; + + /** + * The digest of the content, as defined by the Registry V2 HTTP API + * Specification. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * The number of bytes of the content. Same as Size field. + */ + @JsonProperty(value = "length") + private Long length; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The direct URL to the content. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get the MIME type of the referenced object. + * + * @return the mediaType value + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the MIME type of the referenced object. + * + * @param mediaType the mediaType value to set + * @return the Target object itself. + */ + public Target withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the number of bytes of the content. Same as Length field. + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Set the number of bytes of the content. Same as Length field. + * + * @param size the size value to set + * @return the Target object itself. + */ + public Target withSize(Long size) { + this.size = size; + return this; + } + + /** + * Get the digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @param digest the digest value to set + * @return the Target object itself. + */ + public Target withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Get the number of bytes of the content. Same as Size field. + * + * @return the length value + */ + public Long length() { + return this.length; + } + + /** + * Set the number of bytes of the content. Same as Size field. + * + * @param length the length value to set + * @return the Target object itself. + */ + public Target withLength(Long length) { + this.length = length; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the Target object itself. + */ + public Target withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the direct URL to the content. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the direct URL to the content. + * + * @param url the url value to set + * @return the Target object itself. + */ + public Target withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the Target object itself. + */ + public Target withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Webhook.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Webhook.java new file mode 100644 index 0000000000000..42c7e9ee21b92 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Webhook.java @@ -0,0 +1,247 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.WebhookInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.ContainerRegistryManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing Webhook. + */ +public interface Webhook extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the status value. + */ + WebhookStatus status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Webhook definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithActions, DefinitionStages.WithLocation, DefinitionStages.WithServiceUri, DefinitionStages.WithCreate { + } + + /** + * Grouping of Webhook definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Webhook definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the webhook definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + */ + WithActions withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the webhook definition allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + */ + WithLocation withActions(List actions); + } + + /** + * The stage of the webhook definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithServiceUri withLocation(String location); + } + + /** + * The stage of the webhook definition allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + */ + WithCreate withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook definition allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + */ + WithCreate withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the webhook definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + */ + WithCreate withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCustomHeaders, DefinitionStages.WithScope, DefinitionStages.WithStatus, DefinitionStages.WithTags { + } + } + /** + * The template for a Webhook update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithActions, UpdateStages.WithCustomHeaders, UpdateStages.WithScope, UpdateStages.WithServiceUri, UpdateStages.WithStatus, UpdateStages.WithTags { + } + + /** + * Grouping of Webhook update stages. + */ + interface UpdateStages { + /** + * The stage of the webhook update allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + */ + Update withActions(List actions); + } + + /** + * The stage of the webhook update allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + */ + Update withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook update allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + */ + Update withScope(String scope); + } + + /** + * The stage of the webhook update allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + */ + Update withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + */ + Update withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookAction.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookAction.java new file mode 100644 index 0000000000000..e134397cd61df --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookAction.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.v2017_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookAction. + */ +public final class WebhookAction extends ExpandableStringEnum { + /** Static value push for WebhookAction. */ + public static final WebhookAction PUSH = fromString("push"); + + /** Static value delete for WebhookAction. */ + public static final WebhookAction DELETE = fromString("delete"); + + /** + * Creates or finds a WebhookAction from its string representation. + * @param name a name to look for + * @return the corresponding WebhookAction + */ + @JsonCreator + public static WebhookAction fromString(String name) { + return fromString(name, WebhookAction.class); + } + + /** + * @return known WebhookAction values + */ + public static Collection values() { + return values(WebhookAction.class); + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookCreateParameters.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookCreateParameters.java new file mode 100644 index 0000000000000..376aa845229dd --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookCreateParameters.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for creating a webhook. + */ +@JsonFlatten +public class WebhookCreateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The location of the webhook. This cannot be changed after the resource + * is created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location of the webhook. This cannot be changed after the resource is created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the webhook. This cannot be changed after the resource is created. + * + * @param location the location value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookStatus.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookStatus.java new file mode 100644 index 0000000000000..1cd1cc4dd8d26 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookStatus. + */ +public final class WebhookStatus extends ExpandableStringEnum { + /** Static value enabled for WebhookStatus. */ + public static final WebhookStatus ENABLED = fromString("enabled"); + + /** Static value disabled for WebhookStatus. */ + public static final WebhookStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a WebhookStatus from its string representation. + * @param name a name to look for + * @return the corresponding WebhookStatus + */ + @JsonCreator + public static WebhookStatus fromString(String name) { + return fromString(name, WebhookStatus.class); + } + + /** + * @return known WebhookStatus values + */ + public static Collection values() { + return values(WebhookStatus.class); + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookUpdateParameters.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookUpdateParameters.java new file mode 100644 index 0000000000000..40661cfb78abb --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/WebhookUpdateParameters.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a webhook. + */ +@JsonFlatten +public class WebhookUpdateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri") + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Webhooks.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Webhooks.java new file mode 100644 index 0000000000000..538cee34f6aab --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/Webhooks.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_10_01.implementation.WebhooksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Webhooks. + */ +public interface Webhooks extends SupportsCreating, HasInner { + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable pingAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String webhookName); + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/CallbackConfigImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/CallbackConfigImpl.java new file mode 100644 index 0000000000000..e1bedfaa5e4ba --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/CallbackConfigImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.CallbackConfig; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class CallbackConfigImpl extends WrapperImpl implements CallbackConfig { + private final ContainerRegistryManager manager; + CallbackConfigImpl(CallbackConfigInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Map customHeaders() { + return this.inner().customHeaders(); + } + + @Override + public String serviceUri() { + return this.inner().serviceUri(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/CallbackConfigInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/CallbackConfigInner.java new file mode 100644 index 0000000000000..08e2c5503659c --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/CallbackConfigInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration of service URI and custom headers for the webhook. + */ +public class CallbackConfigInner { + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + private Map customHeaders; + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 0000000000000..930be445f2997 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManagementClientImpl.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.v2017_10_01.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerRegistryManagementClientImpl class. + */ +public class ContainerRegistryManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** The 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; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The RegistriesInner object to access its operations. + */ + private RegistriesInner registries; + + /** + * Gets the RegistriesInner object to access its operations. + * @return the RegistriesInner object. + */ + public RegistriesInner registries() { + return this.registries; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ReplicationsInner object to access its operations. + */ + private ReplicationsInner replications; + + /** + * Gets the ReplicationsInner object to access its operations. + * @return the ReplicationsInner object. + */ + public ReplicationsInner replications() { + return this.replications; + } + + /** + * The WebhooksInner object to access its operations. + */ + private WebhooksInner webhooks; + + /** + * Gets the WebhooksInner object to access its operations. + * @return the WebhooksInner object. + */ + public WebhooksInner webhooks() { + return this.webhooks; + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerRegistryManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.apiVersion = "2017-10-01"; + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.registries = new RegistriesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.replications = new ReplicationsInner(restClient().retrofit(), this); + this.webhooks = new WebhooksInner(restClient().retrofit(), this); + this.azureClient = new AzureClient(this); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s, %s)", super.userAgent(), "ContainerRegistryManagementClient", "2017-10-01"); + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManager.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManager.java new file mode 100644 index 0000000000000..d5fb44d054288 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ContainerRegistryManager.java @@ -0,0 +1,135 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Registries; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Operations; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Replications; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Webhooks; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerRegistry resource management. + */ +public final class ContainerRegistryManager extends ManagerCore { + private Registries registries; + private Operations operations; + private Replications replications; + private Webhooks webhooks; + /** + * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerRegistryManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerRegistryManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerRegistryManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerRegistry management API entry points that work across subscriptions + */ + ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(this); + } + return this.registries; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Replications. + */ + public Replications replications() { + if (this.replications == null) { + this.replications = new ReplicationsImpl(this); + } + return this.replications; + } + + /** + * @return Entry point to manage Webhooks. + */ + public Webhooks webhooks() { + if (this.webhooks == null) { + this.webhooks = new WebhooksImpl(this); + } + return this.webhooks; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerRegistryManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerRegistryManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerRegistryManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventImpl.java new file mode 100644 index 0000000000000..c0cc553f0a89e --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.Event; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_10_01.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2017_10_01.EventResponseMessage; + +class EventImpl extends WrapperImpl implements Event { + private final ContainerRegistryManager manager; + EventImpl(EventInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public EventRequestMessage eventRequestMessage() { + return this.inner().eventRequestMessage(); + } + + @Override + public EventResponseMessage eventResponseMessage() { + return this.inner().eventResponseMessage(); + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInfoImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInfoImpl.java new file mode 100644 index 0000000000000..8753bf06ef138 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInfoImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.EventInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EventInfoImpl extends WrapperImpl implements EventInfo { + private final ContainerRegistryManager manager; + EventInfoImpl(EventInfoInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInfoInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInfoInner.java new file mode 100644 index 0000000000000..b9629ec04c309 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInfoInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The basic information of an event. + */ +public class EventInfoInner { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventInfoInner object itself. + */ + public EventInfoInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInner.java new file mode 100644 index 0000000000000..a7c66a2db12c2 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/EventInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2017_10_01.EventResponseMessage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event for a webhook. + */ +public class EventInner extends EventInfoInner { + /** + * The event request message sent to the service URI. + */ + @JsonProperty(value = "eventRequestMessage") + private EventRequestMessage eventRequestMessage; + + /** + * The event response message received from the service URI. + */ + @JsonProperty(value = "eventResponseMessage") + private EventResponseMessage eventResponseMessage; + + /** + * Get the event request message sent to the service URI. + * + * @return the eventRequestMessage value + */ + public EventRequestMessage eventRequestMessage() { + return this.eventRequestMessage; + } + + /** + * Set the event request message sent to the service URI. + * + * @param eventRequestMessage the eventRequestMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventRequestMessage(EventRequestMessage eventRequestMessage) { + this.eventRequestMessage = eventRequestMessage; + return this; + } + + /** + * Get the event response message received from the service URI. + * + * @return the eventResponseMessage value + */ + public EventResponseMessage eventResponseMessage() { + return this.eventResponseMessage; + } + + /** + * Set the event response message received from the service URI. + * + * @param eventResponseMessage the eventResponseMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventResponseMessage(EventResponseMessage eventResponseMessage) { + this.eventResponseMessage = eventResponseMessage; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/IdParsingUtils.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..85103297424b4 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationDefinitionImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationDefinitionImpl.java new file mode 100644 index 0000000000000..20a9d31084051 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationDefinitionImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.OperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_10_01.OperationDisplayDefinition; + +class OperationDefinitionImpl extends WrapperImpl implements OperationDefinition { + private final ContainerRegistryManager manager; + OperationDefinitionImpl(OperationDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public OperationDisplayDefinition display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationDefinitionInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationDefinitionInner.java new file mode 100644 index 0000000000000..ef6a4f5f4438f --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationDefinitionInner.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.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.OperationDisplayDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a container registry operation. + */ +public class OperationDefinitionInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information for the container registry operation. + * + * @return the display value + */ + public OperationDisplayDefinition display() { + return this.display; + } + + /** + * Set the display information for the container registry operation. + * + * @param display the display value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { + this.display = display; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationsImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..07c2dc6c45d00 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_10_01.OperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerRegistryManager manager; + + OperationsImpl(ContainerRegistryManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationDefinition call(OperationDefinitionInner inner) { + return new OperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationsInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationsInner.java new file mode 100644 index 0000000000000..4b7b5911b08d2 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/OperationsInner.java @@ -0,0 +1,283 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Operations list" }) + @GET("providers/Microsoft.ContainerRegistry/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + 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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/PageImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/PageImpl.java new file mode 100644 index 0000000000000..113abe1b7fbf9 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..f9460e58b11fb --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesImpl.java @@ -0,0 +1,197 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Registries; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Registry; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryListCredentialsResult; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryNameStatus; +import com.microsoft.azure.management.containerregistry.v2017_10_01.ImportImageParameters; +import com.microsoft.azure.management.containerregistry.v2017_10_01.PasswordName; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryUsageListResult; + +class RegistriesImpl extends GroupableResourcesCoreImpl implements Registries { + protected RegistriesImpl(ContainerRegistryManager manager) { + super(manager.inner().registries(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RegistriesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RegistriesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RegistriesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RegistriesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RegistryImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + RegistriesInner client = this.inner(); + return client.importImageAsync(resourceGroupName, registryName, parameters).toCompletable(); + } + + @Override + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listCredentialsAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + RegistriesInner client = this.inner(); + return client.regenerateCredentialAsync(resourceGroupName, registryName, name) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + RegistriesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public RegistryNameStatus call(RegistryNameStatusInner inner) { + return new RegistryNameStatusImpl(inner, manager()); + } + }); + } + + @Override + protected RegistryImpl wrapModel(RegistryInner inner) { + return new RegistryImpl(inner.name(), inner, manager()); + } + + @Override + protected RegistryImpl wrapModel(String name) { + return new RegistryImpl(name, new RegistryInner(), this.manager()); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryUsageListResult call(RegistryUsageListResultInner inner) { + return new RegistryUsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java new file mode 100644 index 0000000000000..4c8fc54d04cf6 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistriesInner.java @@ -0,0 +1,1691 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2017_10_01.ImportImageParameters; +import com.microsoft.azure.management.containerregistry.v2017_10_01.PasswordName; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegenerateCredentialParameters; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryNameCheckRequest; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Registries. + */ +public class RegistriesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RegistriesService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RegistriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Registries to be + * used by Retrofit to perform actually REST calls. + */ + interface RegistriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries importImage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage") + Observable> importImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body ImportImageParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries beginImportImage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage") + Observable> beginImportImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body ImportImageParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegistryNameCheckRequest registryNameCheckRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries listCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials") + Observable> listCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries regenerateCredential" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential") + Observable> regenerateCredential(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateCredentialParameters regenerateCredentialParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Registries listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().last().body(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters), serviceCallback); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + return importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> importImageWithServiceResponseAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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, ImportImageParameters parameters) { + beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().single().body(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginImportImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters), serviceCallback); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginImportImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + return beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginImportImageWithServiceResponseAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryNameStatusInner object if successful. + */ + public RegistryNameStatusInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, RegistryNameStatusInner>() { + @Override + public RegistryNameStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (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."); + } + RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); + registryNameCheckRequest.withName(name); + 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) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().last().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginCreate(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().single().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().last().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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()); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner update(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginUpdate(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listCredentialsAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCredentialsWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> listCredentialsWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = listCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner regenerateCredential(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).toBlocking().single().body(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name), serviceCallback); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> regenerateCredentialWithServiceResponseAsync(String resourceGroupName, String registryName, PasswordName name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (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."); + } + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateCredentialDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateCredentialDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryUsageListResultInner object if successful. + */ + public RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listUsagesAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryUsageListResultInner object + */ + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryUsageListResultInner>() { + @Override + public RegistryUsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryUsageListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..f8fbda520871f --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryImpl.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Registry; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_10_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Status; +import com.microsoft.azure.management.containerregistry.v2017_10_01.StorageAccountProperties; +import rx.functions.Func1; + +class RegistryImpl extends GroupableResourceCoreImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryUpdateParameters updateParameter; + RegistryImpl(String name, RegistryInner inner, ContainerRegistryManager manager) { + super(name, inner, manager); + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Boolean adminUserEnabled() { + return this.inner().adminUserEnabled(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String loginServer() { + return this.inner().loginServer(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public StorageAccountProperties storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public RegistryImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.inner().withAdminUserEnabled(adminUserEnabled); + } else { + this.updateParameter.withAdminUserEnabled(adminUserEnabled); + } + return this; + } + + @Override + public RegistryImpl withStorageAccount(StorageAccountProperties storageAccount) { + if (isInCreateMode()) { + this.inner().withStorageAccount(storageAccount); + } else { + this.updateParameter.withStorageAccount(storageAccount); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryInner.java new file mode 100644 index 0000000000000..65021b6d83479 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryInner.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2017_10_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Status; +import com.microsoft.azure.management.containerregistry.v2017_10_01.StorageAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a container registry. + */ +@JsonFlatten +public class RegistryInner extends Resource { + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "properties.loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /** + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The provisioning state of the container registry at the time the + * operation was called. Possible values include: 'Creating', 'Updating', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the container registry at the time the operation was + * called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The properties of the storage account for the container registry. Only + * applicable to Classic SKU. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the URL that can be used to log into the container registry. + * + * @return the loginServer value + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creation date of the container registry in ISO8601 format. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the container registry at the time the operation was called. + * + * @return the status value + */ + public Status status() { + return this.status; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the properties of the storage account for the container registry. Only applicable to Classic SKU. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the properties of the storage account for the container registry. Only applicable to Classic SKU. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryListCredentialsResultImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryListCredentialsResultImpl.java new file mode 100644 index 0000000000000..c92c5560b0024 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryListCredentialsResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryListCredentialsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryPassword; + +class RegistryListCredentialsResultImpl extends WrapperImpl implements RegistryListCredentialsResult { + private final ContainerRegistryManager manager; + RegistryListCredentialsResultImpl(RegistryListCredentialsResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List passwords() { + return this.inner().passwords(); + } + + @Override + public String username() { + return this.inner().username(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryListCredentialsResultInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryListCredentialsResultInner.java new file mode 100644 index 0000000000000..1ab42005be8f3 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryListCredentialsResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListCredentials operation. + */ +public class RegistryListCredentialsResultInner { + /** + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username for a container registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for a container registry. + * + * @param username the username value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the list of passwords for a container registry. + * + * @return the passwords value + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the list of passwords for a container registry. + * + * @param passwords the passwords value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryNameStatusImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryNameStatusImpl.java new file mode 100644 index 0000000000000..7eb80ca7034ea --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryNameStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryNameStatusImpl extends WrapperImpl implements RegistryNameStatus { + private final ContainerRegistryManager manager; + RegistryNameStatusImpl(RegistryNameStatusInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryNameStatusInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryNameStatusInner.java new file mode 100644 index 0000000000000..6b4ee2cac236d --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryNameStatusInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to check the availability of a container registry + * name. + */ +public class RegistryNameStatusInner { + /** + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value that indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the value that indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get if any, the reason that the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set if any, the reason that the name is not available. + * + * @param reason the reason value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get if any, the error message that provides more detail for the reason that the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if any, the error message that provides more detail for the reason that the name is not available. + * + * @param message the message value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryUsageListResultImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryUsageListResultImpl.java new file mode 100644 index 0000000000000..4044b685031f8 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryUsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryUsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryUsage; + +class RegistryUsageListResultImpl extends WrapperImpl implements RegistryUsageListResult { + private final ContainerRegistryManager manager; + RegistryUsageListResultImpl(RegistryUsageListResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryUsageListResultInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryUsageListResultInner.java new file mode 100644 index 0000000000000..e16f45c777dbb --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/RegistryUsageListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_10_01.RegistryUsage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to get container registry quota usages. + */ +public class RegistryUsageListResultInner { + /** + * The list of container registry quota usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of container registry quota usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of container registry quota usages. + * + * @param value the value value to set + * @return the RegistryUsageListResultInner object itself. + */ + public RegistryUsageListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationImpl.java new file mode 100644 index 0000000000000..cedf4d7b570ec --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.Replication; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2017_10_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Status; + +class ReplicationImpl extends CreatableUpdatableImpl implements Replication, Replication.Definition, Replication.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String replicationName; + + ReplicationImpl(String name, ContainerRegistryManager manager) { + super(name, new ReplicationInner()); + this.manager = manager; + // Set resource name + this.replicationName = name; + // + } + + ReplicationImpl(ReplicationInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.replicationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.replicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "replications"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.getAsync(this.resourceGroupName, this.registryName, this.replicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ReplicationImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public ReplicationImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ReplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationInner.java new file mode 100644 index 0000000000000..74acabf6c036f --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationInner.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a replication for a container registry. + */ +@JsonFlatten +public class ReplicationInner extends Resource { + /** + * The provisioning state of the replication at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the replication at the time the operation was called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /** + * Get the provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the replication at the time the operation was called. + * + * @return the status value + */ + public Status status() { + return this.status; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationsImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationsImpl.java new file mode 100644 index 0000000000000..fb70b73d6a848 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Replications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Replication; + +class ReplicationsImpl extends WrapperImpl implements Replications { + private final ContainerRegistryManager manager; + + ReplicationsImpl(ContainerRegistryManager manager) { + super(manager.inner().replications()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public ReplicationImpl define(String name) { + return wrapModel(name); + } + + private ReplicationImpl wrapModel(ReplicationInner inner) { + return new ReplicationImpl(inner, manager()); + } + + private ReplicationImpl wrapModel(String name) { + return new ReplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + ReplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, replicationName) + .map(new Func1() { + @Override + public Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, replicationName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationsInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationsInner.java new file mode 100644 index 0000000000000..bde4682ddb05f --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/ReplicationsInner.java @@ -0,0 +1,1138 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.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.v2017_10_01.ReplicationUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Replications. + */ +public class ReplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ReplicationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReplicationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(ReplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Replications to be + * used by Retrofit to perform actually REST calls. + */ + interface ReplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Replications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner get(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner create(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().last().body(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginCreate(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().single().body(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String replicationName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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()); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String replicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String replicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().last().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + 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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + 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, this.client.apiVersion(), this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().single().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + Validator.validate(tags); + 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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ReplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ReplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhookImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhookImpl.java new file mode 100644 index 0000000000000..998c93a249d5b --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhookImpl.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.Webhook; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2017_10_01.WebhookUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_10_01.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2017_10_01.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2017_10_01.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2017_10_01.WebhookStatus; +import rx.functions.Func1; + +class WebhookImpl extends CreatableUpdatableImpl implements Webhook, Webhook.Definition, Webhook.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String webhookName; + private WebhookCreateParameters createParameter; + private WebhookUpdateParameters updateParameter; + + WebhookImpl(String name, ContainerRegistryManager manager) { + super(name, new WebhookInner()); + this.manager = manager; + // Set resource name + this.webhookName = name; + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + WebhookImpl(WebhookInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.webhookName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.webhookName = IdParsingUtils.getValueFromIdByName(inner.id(), "webhooks"); + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.createAsync(this.resourceGroupName, this.registryName, this.webhookName, this.createParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.webhookName, this.updateParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.getAsync(this.resourceGroupName, this.registryName, this.webhookName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public WebhookStatus status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WebhookImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public WebhookImpl withLocation(String location) { + this.createParameter.withLocation(location); + return this; + } + + @Override + public WebhookImpl withActions(List actions) { + if (isInCreateMode()) { + this.createParameter.withActions(actions); + } else { + this.updateParameter.withActions(actions); + } + return this; + } + + @Override + public WebhookImpl withServiceUri(String serviceUri) { + if (isInCreateMode()) { + this.createParameter.withServiceUri(serviceUri); + } else { + this.updateParameter.withServiceUri(serviceUri); + } + return this; + } + + @Override + public WebhookImpl withCustomHeaders(Map customHeaders) { + if (isInCreateMode()) { + this.createParameter.withCustomHeaders(customHeaders); + } else { + this.updateParameter.withCustomHeaders(customHeaders); + } + return this; + } + + @Override + public WebhookImpl withScope(String scope) { + if (isInCreateMode()) { + this.createParameter.withScope(scope); + } else { + this.updateParameter.withScope(scope); + } + return this; + } + + @Override + public WebhookImpl withStatus(WebhookStatus status) { + if (isInCreateMode()) { + this.createParameter.withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + + @Override + public WebhookImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameter.withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhookInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhookInner.java new file mode 100644 index 0000000000000..47d59caf5d988 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhookInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.management.containerregistry.v2017_10_01.WebhookStatus; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2017_10_01.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2017_10_01.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a webhook for a container registry. + */ +@JsonFlatten +public class WebhookInner extends Resource { + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * The provisioning state of the webhook at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the provisioning state of the webhook at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhooksImpl.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhooksImpl.java new file mode 100644 index 0000000000000..1ec760d08e645 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhooksImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Webhooks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2017_10_01.EventInfo; +import com.microsoft.azure.management.containerregistry.v2017_10_01.CallbackConfig; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Event; +import com.microsoft.azure.management.containerregistry.v2017_10_01.Webhook; + +class WebhooksImpl extends WrapperImpl implements Webhooks { + private final ContainerRegistryManager manager; + + WebhooksImpl(ContainerRegistryManager manager) { + super(manager.inner().webhooks()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public WebhookImpl define(String name) { + return wrapModel(name); + } + + private WebhookImpl wrapModel(WebhookInner inner) { + return new WebhookImpl(inner, manager()); + } + + private WebhookImpl wrapModel(String name) { + return new WebhookImpl(name, this.manager()); + } + + @Override + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.pingAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public EventInfo call(EventInfoInner inner) { + return new EventInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getCallbackConfigAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public CallbackConfig call(CallbackConfigInner inner) { + return new CallbackConfigImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + WebhooksInner client = this.inner(); + return client.listEventsAsync(resourceGroupName, registryName, webhookName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Event call(EventInner inner) { + return new EventImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + WebhooksInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, webhookName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhooksInner.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhooksInner.java new file mode 100644 index 0000000000000..e28a4e97383aa --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/WebhooksInner.java @@ -0,0 +1,1418 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2017_10_01.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.v2017_10_01.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2017_10_01.WebhookUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Webhooks. + */ +public class WebhooksInner { + /** The Retrofit service to perform REST calls. */ + private WebhooksService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of WebhooksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebhooksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(WebhooksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Webhooks to be + * used by Retrofit to perform actually REST calls. + */ + interface WebhooksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.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.v2017_10_01.Webhooks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Webhooks beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.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.v2017_10_01.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.v2017_10_01.Webhooks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.Webhooks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2017_10_01.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.v2017_10_01.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.v2017_10_01.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.v2017_10_01.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.v2017_10_01.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.v2017_10_01.Webhooks listEventsNext" }) + @GET + Observable> listEventsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner get(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner create(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginCreate(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String webhookName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().last().body(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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()); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String webhookName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String webhookName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner update(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginUpdate(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebhookInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (this.client.apiVersion() == null) { + throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); + } + return service.list(this.client.subscriptionId(), resourceGroupName, registryName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventInfoInner object if successful. + */ + public EventInfoInner ping(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture pingAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, EventInfoInner>() { + @Override + public EventInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable> pingWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = pingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse pingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CallbackConfigInner object if successful. + */ + public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, CallbackConfigInner>() { + @Override + public CallbackConfigInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable> getCallbackConfigWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse clientResponse = getCallbackConfigDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCallbackConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEvents(final String resourceGroupName, final String registryName, final String webhookName) { + ServiceResponse> response = listEventsSinglePageAsync(resourceGroupName, registryName, webhookName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsSinglePageAsync(resourceGroupName, registryName, webhookName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsWithServiceResponseAsync(resourceGroupName, registryName, webhookName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsSinglePageAsync(resourceGroupName, registryName, webhookName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + ServiceResponse> * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsSinglePageAsync(final String resourceGroupName, final String registryName, final String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + 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) { + try { + ServiceResponse> result = listEventsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebhookInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEventsNext(final String nextPageLink) { + ServiceResponse> response = listEventsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsNextAsync(final String nextPageLink) { + return listEventsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsNextWithServiceResponseAsync(final String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listEventsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/package-info.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/package-info.java new file mode 100644 index 0000000000000..ca74b27271210 --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2017_10_01.implementation; diff --git a/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/package-info.java b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/package-info.java new file mode 100644 index 0000000000000..be406c8ec31fb --- /dev/null +++ b/containerregistry/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_10_01/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2017_10_01; diff --git a/containerregistry/resource-manager/v2018_02_01_preview/pom.xml b/containerregistry/resource-manager/v2018_02_01_preview/pom.xml new file mode 100644 index 0000000000000..d9074e79ac67f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + com.microsoft.azure.containerregistry.v2018_02_01_preview + + com.microsoft.azure + azure-arm-parent + 0.0.2-beta + ../../../pom.xml + + azure-mgmt-containerregistry + 1.0.0-beta + jar + Microsoft Azure SDK for ContainerRegistry Management + This package contains Microsoft ContainerRegistry Management SDK. + https://github.com/Azure/azure-libraries-for-java + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + scm:git:https://github.com/Azure/azure-libraries-for-java + scm:git:git@github.com:Azure/azure-libraries-for-java.git + HEAD + + + UTF-8 + + + + + microsoft + Microsoft + + + + + com.microsoft.azure + azure-client-runtime + + + com.microsoft.azure + azure-arm-client-runtime + + + junit + junit + test + + + com.microsoft.azure + azure-client-authentication + test + + + com.microsoft.azure + azure-mgmt-resources + test + + + com.microsoft.azure + azure-arm-client-runtime + test-jar + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + true + + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + 1.7 + 1.7 + + + com.microsoft.azure.management.apigeneration.LangDefinitionProcessor + + + true + true + + true + true + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.8 + + *.implementation.*;*.utils.*;com.microsoft.schemas._2003._10.serialization;*.blob.core.search + + + /** +
* Copyright (c) Microsoft Corporation. All rights reserved. +
* Licensed under the MIT License. See License.txt in the project root for +
* license information. +
*/ + ]]> +
+
+
+
+
+
diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Actor.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Actor.java new file mode 100644 index 0000000000000..1da3446fa3661 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Actor.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The agent that initiated the event. For most situations, this could be from + * the authorization context of the request. + */ +public class Actor { + /** + * The subject or username associated with the request context that + * generated the event. + */ + @JsonProperty(value = "name") + private String name; + + /** + * Get the subject or username associated with the request context that generated the event. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the subject or username associated with the request context that generated the event. + * + * @param name the name value to set + * @return the Actor object itself. + */ + public Actor withName(String name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageDependency.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageDependency.java new file mode 100644 index 0000000000000..2763a23839c01 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageDependency.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties that describe a base image dependency. + */ +public class BaseImageDependency { + /** + * The type of the base image dependency. Possible values include: + * 'BuildTime', 'RunTime'. + */ + @JsonProperty(value = "type") + private BaseImageDependencyType type; + + /** + * The registry login server. + */ + @JsonProperty(value = "registry") + private String registry; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * The sha256-based digest of the image manifest. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * Get the type of the base image dependency. Possible values include: 'BuildTime', 'RunTime'. + * + * @return the type value + */ + public BaseImageDependencyType type() { + return this.type; + } + + /** + * Set the type of the base image dependency. Possible values include: 'BuildTime', 'RunTime'. + * + * @param type the type value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withType(BaseImageDependencyType type) { + this.type = type; + return this; + } + + /** + * Get the registry login server. + * + * @return the registry value + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry login server. + * + * @param registry the registry value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withRegistry(String registry) { + this.registry = registry; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the sha256-based digest of the image manifest. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the sha256-based digest of the image manifest. + * + * @param digest the digest value to set + * @return the BaseImageDependency object itself. + */ + public BaseImageDependency withDigest(String digest) { + this.digest = digest; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageDependencyType.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageDependencyType.java new file mode 100644 index 0000000000000..94259e8cdd842 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageDependencyType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BaseImageDependencyType. + */ +public final class BaseImageDependencyType extends ExpandableStringEnum { + /** Static value BuildTime for BaseImageDependencyType. */ + public static final BaseImageDependencyType BUILD_TIME = fromString("BuildTime"); + + /** Static value RunTime for BaseImageDependencyType. */ + public static final BaseImageDependencyType RUN_TIME = fromString("RunTime"); + + /** + * Creates or finds a BaseImageDependencyType from its string representation. + * @param name a name to look for + * @return the corresponding BaseImageDependencyType + */ + @JsonCreator + public static BaseImageDependencyType fromString(String name) { + return fromString(name, BaseImageDependencyType.class); + } + + /** + * @return known BaseImageDependencyType values + */ + public static Collection values() { + return values(BaseImageDependencyType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageTriggerType.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BaseImageTriggerType.java new file mode 100644 index 0000000000000..2f2010394e56a --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for BaseImageTriggerType. + */ +public final class BaseImageTriggerType extends ExpandableStringEnum { + /** Static value All for BaseImageTriggerType. */ + public static final BaseImageTriggerType ALL = fromString("All"); + + /** Static value Runtime for BaseImageTriggerType. */ + public static final BaseImageTriggerType RUNTIME = fromString("Runtime"); + + /** 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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Build.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Build.java new file mode 100644 index 0000000000000..5fef710c89053 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Build.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import java.util.List; + +/** + * Type representing Build. + */ +public interface Build extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the buildId value. + */ + String buildId(); + + /** + * @return the buildTask value. + */ + String buildTask(); + + /** + * @return the buildType value. + */ + BuildType buildType(); + + /** + * @return the createTime value. + */ + DateTime createTime(); + + /** + * @return the finishTime value. + */ + DateTime finishTime(); + + /** + * @return the gitCommitTrigger value. + */ + GitCommitTrigger gitCommitTrigger(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the imageUpdateTrigger value. + */ + ImageUpdateTrigger imageUpdateTrigger(); + + /** + * @return the isArchiveEnabled value. + */ + Boolean isArchiveEnabled(); + + /** + * @return the lastUpdatedTime value. + */ + DateTime lastUpdatedTime(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the outputImages value. + */ + List outputImages(); + + /** + * @return the platform value. + */ + PlatformProperties platform(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the startTime value. + */ + DateTime startTime(); + + /** + * @return the status value. + */ + BuildStatus status(); + + /** + * @return the type value. + */ + String type(); + + /** + * The template for a Build update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable { + } + + /** + * Grouping of Build update stages. + */ + interface UpdateStages { + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildArgument.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildArgument.java new file mode 100644 index 0000000000000..0d0b6ecf406ee --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildArgument.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildArgumentInner; + +/** + * Type representing BuildArgument. + */ +public interface BuildArgument extends HasInner, HasManager { + /** + * @return the isSecret value. + */ + Boolean isSecret(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the type value. + */ + String type(); + + /** + * @return the value value. + */ + String value(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildFilter.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildFilter.java new file mode 100644 index 0000000000000..ab5e2076e2a56 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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', 'Error', + * '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 unique identifier for the build. + * + * @return the buildId value + */ + public String buildId() { + return this.buildId; + } + + /** + * Set the unique identifier for the build. + * + * @param buildId the buildId value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withBuildId(String buildId) { + this.buildId = buildId; + return this; + } + + /** + * Get the type of build. Possible values include: 'AutoBuild', 'QuickBuild'. + * + * @return the buildType value + */ + public BuildType buildType() { + return this.buildType; + } + + /** + * Set the type of build. Possible values include: 'AutoBuild', 'QuickBuild'. + * + * @param buildType the buildType value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withBuildType(BuildType buildType) { + this.buildType = buildType; + return this; + } + + /** + * Get the current status of the build. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @return the status value + */ + public BuildStatus status() { + return this.status; + } + + /** + * Set the current status of the build. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @param status the status value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withStatus(BuildStatus status) { + this.status = status; + return this; + } + + /** + * Get the create time for a build. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the create time for a build. + * + * @param createTime the createTime value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the time the build finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the time the build finished. + * + * @param finishTime the finishTime value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the list of all images that were generated from the build. + * + * @return the outputImageNames value + */ + public List outputImageNames() { + return this.outputImageNames; + } + + /** + * Set the list of all images that were generated from the build. + * + * @param outputImageNames the outputImageNames value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withOutputImageNames(List outputImageNames) { + this.outputImageNames = outputImageNames; + return this; + } + + /** + * Get the value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the BuildFilter object itself. + */ + public BuildFilter withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the name of the build task that the build corresponds to. + * + * @return the buildTaskName value + */ + public String buildTaskName() { + return this.buildTaskName; + } + + /** + * Set the name of the build task that the build corresponds to. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildGetLogResult.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildGetLogResult.java new file mode 100644 index 0000000000000..775dcbb861aa6 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildGetLogResult.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.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildGetLogResultInner; + +/** + * Type representing BuildGetLogResult. + */ +public interface BuildGetLogResult extends HasInner, HasManager { + /** + * @return the logLink value. + */ + String logLink(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStatus.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStatus.java new file mode 100644 index 0000000000000..5d6a58d40e3e4 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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 Error for BuildStatus. */ + public static final BuildStatus ERROR = fromString("Error"); + + /** 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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStep.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStep.java new file mode 100644 index 0000000000000..79999c2e6a481 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStep.java @@ -0,0 +1,111 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildStepInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; + +/** + * Type representing BuildStep. + */ +public interface BuildStep extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the properties value. + */ + BuildStepProperties properties(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BuildStep definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithBuildTask, DefinitionStages.WithCreate { + } + + /** + * Grouping of BuildStep definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BuildStep definition. + */ + interface Blank extends WithBuildTask { + } + + /** + * The stage of the buildstep definition allowing to specify BuildTask. + */ + interface WithBuildTask { + /** + * Specifies resourceGroupName, registryName, buildTaskName. + */ + WithCreate withExistingBuildTask(String resourceGroupName, String registryName, String buildTaskName); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable { + } + } + /** + * The template for a BuildStep update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithProperties, UpdateStages.WithTags { + } + + /** + * Grouping of BuildStep update stages. + */ + interface UpdateStages { + /** + * The stage of the buildstep update allowing to specify Properties. + */ + interface WithProperties { + /** + * Specifies properties. + */ + Update withProperties(BuildStepPropertiesUpdateParameters properties); + } + + /** + * The stage of the buildstep update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepProperties.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepProperties.java new file mode 100644 index 0000000000000..e18ebf839f50d --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepProperties.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.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * Base properties for 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 BuildStepProperties { + /** + * 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 provisioning state of the build step. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepPropertiesUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepPropertiesUpdateParameters.java new file mode 100644 index 0000000000000..a8c2352e8fdb2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepUpdateParameters.java new file mode 100644 index 0000000000000..e9b8387b74985 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildStepUpdateParameters.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.v2018_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for updating a build step. + */ +public class BuildStepUpdateParameters { + /** + * 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 for updating a build step. + * + * @return the properties value + */ + public BuildStepPropertiesUpdateParameters properties() { + return this.properties; + } + + /** + * Set the properties for updating a build step. + * + * @param properties the properties value to set + * @return the BuildStepUpdateParameters object itself. + */ + public BuildStepUpdateParameters withProperties(BuildStepPropertiesUpdateParameters properties) { + this.properties = properties; + return this; + } + + /** + * Get the ARM resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the ARM resource tags. + * + * @param tags the tags value to set + * @return the BuildStepUpdateParameters object itself. + */ + public BuildStepUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildSteps.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildSteps.java new file mode 100644 index 0000000000000..8cfb03b0b1638 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildSteps.java @@ -0,0 +1,68 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildStepsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BuildSteps. + */ +public interface BuildSteps extends SupportsCreating, HasInner { + /** + * 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 for the request + */ + Observable listBuildArgumentsAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName); + + /** + * 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 for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName); + + /** + * 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 for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName, final String buildTaskName); + + /** + * 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 + */ + Completable deleteAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTask.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTask.java new file mode 100644 index 0000000000000..b97010d1a5372 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTask.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildTaskInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.SourceRepositoryPropertiesInner; + +/** + * Type representing BuildTask. + */ +public interface BuildTask extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the alias value. + */ + String alias(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the platform value. + */ + PlatformProperties platform(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sourceRepository value. + */ + SourceRepositoryProperties sourceRepository(); + + /** + * @return the status value. + */ + BuildTaskStatus status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the timeout value. + */ + Integer timeout(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the BuildTask definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithAlias, DefinitionStages.WithLocation, DefinitionStages.WithPlatform, DefinitionStages.WithSourceRepository, DefinitionStages.WithCreate { + } + + /** + * Grouping of BuildTask definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a BuildTask definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the buildtask definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + */ + WithAlias withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the buildtask definition allowing to specify Alias. + */ + interface WithAlias { + /** + * Specifies alias. + */ + WithLocation withAlias(String alias); + } + + /** + * The stage of the buildtask definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithPlatform withLocation(String location); + } + + /** + * The stage of the buildtask definition allowing to specify Platform. + */ + interface WithPlatform { + /** + * Specifies platform. + */ + WithSourceRepository withPlatform(PlatformProperties platform); + } + + /** + * The stage of the buildtask definition allowing to specify SourceRepository. + */ + interface WithSourceRepository { + /** + * Specifies sourceRepository. + */ + WithCreate withSourceRepository(SourceRepositoryPropertiesInner sourceRepository); + } + + /** + * The stage of the buildtask definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + */ + WithCreate withStatus(BuildTaskStatus status); + } + + /** + * The stage of the buildtask definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the buildtask definition allowing to specify Timeout. + */ + interface WithTimeout { + /** + * Specifies timeout. + */ + WithCreate withTimeout(Integer timeout); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithStatus, DefinitionStages.WithTags, DefinitionStages.WithTimeout { + } + } + /** + * The template for a BuildTask update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithAlias, UpdateStages.WithPlatform, UpdateStages.WithSourceRepository, UpdateStages.WithStatus, UpdateStages.WithTags, UpdateStages.WithTimeout { + } + + /** + * Grouping of BuildTask update stages. + */ + interface UpdateStages { + /** + * The stage of the buildtask update allowing to specify Alias. + */ + interface WithAlias { + /** + * Specifies alias. + */ + Update withAlias(String alias); + } + + /** + * The stage of the buildtask update allowing to specify Platform. + */ + interface WithPlatform { + /** + * Specifies platform. + */ + Update withPlatform(PlatformProperties platform); + } + + /** + * The stage of the buildtask update allowing to specify SourceRepository. + */ + interface WithSourceRepository { + /** + * Specifies sourceRepository. + */ + Update withSourceRepository(SourceRepositoryUpdateParameters sourceRepository); + } + + /** + * The stage of the buildtask update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + */ + Update withStatus(BuildTaskStatus status); + } + + /** + * The stage of the buildtask update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + /** + * The stage of the buildtask update allowing to specify Timeout. + */ + interface WithTimeout { + /** + * Specifies timeout. + */ + Update withTimeout(Integer timeout); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskBuildRequest.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskBuildRequest.java new file mode 100644 index 0000000000000..1a37d8f51cf6c --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskBuildRequest.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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 QueueBuildRequest { + /** + * The name of build task against which build has to be queued. + */ + @JsonProperty(value = "buildTaskName", required = true) + private String buildTaskName; + + /** + * Get the name of build task against which build has to be queued. + * + * @return the buildTaskName value + */ + public String buildTaskName() { + return this.buildTaskName; + } + + /** + * Set the name of build task against which build has to be queued. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskFilter.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskFilter.java new file mode 100644 index 0000000000000..0e4d5bcbf2a50 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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 alternative name for build task. + * + * @return the alias value + */ + public String alias() { + return this.alias; + } + + /** + * Set the alternative name for build task. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskStatus.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskStatus.java new file mode 100644 index 0000000000000..aa6bec1ed734a --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskUpdateParameters.java new file mode 100644 index 0000000000000..14fe403ffa53d --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTaskUpdateParameters.java @@ -0,0 +1,177 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +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 BuildTaskUpdateParameters { + /** + * 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 alternative updatable name for a build task. + * + * @return the alias value + */ + public String alias() { + return this.alias; + } + + /** + * Set the alternative updatable name for a build task. + * + * @param alias the alias value to set + * @return the BuildTaskUpdateParameters object itself. + */ + public BuildTaskUpdateParameters withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get the current status of build task. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public BuildTaskStatus status() { + return this.status; + } + + /** + * Set the current status of build task. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the BuildTaskUpdateParameters object itself. + */ + public BuildTaskUpdateParameters withStatus(BuildTaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the platform properties against which the build has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the build has to happen. + * + * @param platform the platform value to set + * @return the BuildTaskUpdateParameters object itself. + */ + public BuildTaskUpdateParameters withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get build timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set build timeout in seconds. + * + * @param timeout the timeout value to set + * @return the BuildTaskUpdateParameters object itself. + */ + public BuildTaskUpdateParameters withTimeout(Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Get the properties that describes the source(code) for the build task. + * + * @return the sourceRepository value + */ + public SourceRepositoryUpdateParameters sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the properties that describes the source(code) for the build task. + * + * @param sourceRepository the sourceRepository value to set + * @return the BuildTaskUpdateParameters object itself. + */ + public BuildTaskUpdateParameters withSourceRepository(SourceRepositoryUpdateParameters sourceRepository) { + this.sourceRepository = sourceRepository; + return this; + } + + /** + * Get the ARM resource tags. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the ARM resource tags. + * + * @param tags the tags value to set + * @return the BuildTaskUpdateParameters object itself. + */ + public BuildTaskUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTasks.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTasks.java new file mode 100644 index 0000000000000..52910905ef86d --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildTasks.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildTasksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing BuildTasks. + */ +public interface BuildTasks extends SupportsCreating, HasInner { + /** + * 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 for the request + */ + Observable listSourceRepositoryPropertiesAsync(String resourceGroupName, String registryName, String buildTaskName); + + /** + * 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 for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String buildTaskName); + + /** + * 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 for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * 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 + */ + Completable deleteAsync(String resourceGroupName, String registryName, String buildTaskName); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildType.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildType.java new file mode 100644 index 0000000000000..50013e19f5110 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/BuildUpdateParameters.java new file mode 100644 index 0000000000000..3b03d83c0b23f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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 value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the BuildUpdateParameters object itself. + */ + public BuildUpdateParameters withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Builds.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Builds.java new file mode 100644 index 0000000000000..7896de2d4f514 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Builds.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.v2018_02_01_preview; + +import rx.Observable; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Builds. + */ +public interface Builds extends HasInner { + /** + * 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 for the request + */ + Observable getLogLinkAsync(String resourceGroupName, String registryName, String buildId); + + /** + * 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 + */ + Completable cancelAsync(String resourceGroupName, String registryName, String buildId); + + /** + * 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 for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String buildId); + + /** + * 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 for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/CallbackConfig.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/CallbackConfig.java new file mode 100644 index 0000000000000..35666f83a3484 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/CallbackConfig.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.CallbackConfigInner; +import java.util.Map; + +/** + * Type representing CallbackConfig. + */ +public interface CallbackConfig extends HasInner, HasManager { + /** + * @return the customHeaders value. + */ + Map customHeaders(); + + /** + * @return the serviceUri value. + */ + String serviceUri(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/DockerBuildStep.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/DockerBuildStep.java new file mode 100644 index 0000000000000..8a8ce7528c8a8 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/DockerBuildStep.java @@ -0,0 +1,249 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildArgumentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * The Docker build step. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") +@JsonTypeName("Docker") +public class DockerBuildStep extends BuildStepProperties { + /** + * 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 repository branch name. + * + * @return the branch value + */ + public String branch() { + return this.branch; + } + + /** + * Set the repository branch name. + * + * @param branch the branch value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the Docker file path relative to the source control root. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source control root. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the relative context path for a docker build in the source. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the relative context path for a docker build in the source. + * + * @param contextPath the contextPath value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the custom arguments for building this build step. + * + * @return the buildArguments value + */ + public List buildArguments() { + return this.buildArguments; + } + + /** + * Set the custom arguments for building this build step. + * + * @param buildArguments the buildArguments value to set + * @return the DockerBuildStep object itself. + */ + public DockerBuildStep withBuildArguments(List buildArguments) { + this.buildArguments = buildArguments; + return this; + } + + /** + * Get list of base image dependencies for a step. + * + * @return the baseImageDependencies value + */ + public List baseImageDependencies() { + return this.baseImageDependencies; + } + + /** + * Get the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime', 'None'. + * + * @return the baseImageTrigger value + */ + public BaseImageTriggerType baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime', 'None'. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/DockerBuildStepUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/DockerBuildStepUpdateParameters.java new file mode 100644 index 0000000000000..05895e01f5dda --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.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 repository branch name. + * + * @return the branch value + */ + public String branch() { + return this.branch; + } + + /** + * Set the repository branch name. + * + * @param branch the branch value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withBranch(String branch) { + this.branch = branch; + return this; + } + + /** + * Get the fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get the Docker file path relative to the source control root. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source control root. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + + /** + * Get the relative context path for a docker build in the source. + * + * @return the contextPath value + */ + public String contextPath() { + return this.contextPath; + } + + /** + * Set the relative context path for a docker build in the source. + * + * @param contextPath the contextPath value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withContextPath(String contextPath) { + this.contextPath = contextPath; + return this; + } + + /** + * Get the custom arguments for building this build step. + * + * @return the buildArguments value + */ + public List buildArguments() { + return this.buildArguments; + } + + /** + * Set the custom arguments for building this build step. + * + * @param buildArguments the buildArguments value to set + * @return the DockerBuildStepUpdateParameters object itself. + */ + public DockerBuildStepUpdateParameters withBuildArguments(List buildArguments) { + this.buildArguments = buildArguments; + return this; + } + + /** + * Get the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime', 'None'. + * + * @return the baseImageTrigger value + */ + public BaseImageTriggerType baseImageTrigger() { + return this.baseImageTrigger; + } + + /** + * Set the type of the auto trigger for base image dependency updates. Possible values include: 'All', 'Runtime', 'None'. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Event.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Event.java new file mode 100644 index 0000000000000..97c7507b15726 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Event.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.EventInner; + +/** + * Type representing Event. + */ +public interface Event extends HasInner, HasManager { + /** + * @return the eventRequestMessage value. + */ + EventRequestMessage eventRequestMessage(); + + /** + * @return the eventResponseMessage value. + */ + EventResponseMessage eventResponseMessage(); + + /** + * @return the id value. + */ + String id(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventContent.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventContent.java new file mode 100644 index 0000000000000..25b67e595ef9c --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventContent.java @@ -0,0 +1,202 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The content of the event request message. + */ +public class EventContent { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The time at which the event occurred. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * The action that encompasses the provided event. + */ + @JsonProperty(value = "action") + private String action; + + /** + * The target of the event. + */ + @JsonProperty(value = "target") + private Target target; + + /** + * The request that generated the event. + */ + @JsonProperty(value = "request") + private Request request; + + /** + * The agent that initiated the event. For most situations, this could be + * from the authorization context of the request. + */ + @JsonProperty(value = "actor") + private Actor actor; + + /** + * The registry node that generated the event. Put differently, while the + * actor initiates the event, the source generates it. + */ + @JsonProperty(value = "source") + private Source source; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventContent object itself. + */ + public EventContent withId(String id) { + this.id = id; + return this; + } + + /** + * Get the time at which the event occurred. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the time at which the event occurred. + * + * @param timestamp the timestamp value to set + * @return the EventContent object itself. + */ + public EventContent withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the action that encompasses the provided event. + * + * @return the action value + */ + public String action() { + return this.action; + } + + /** + * Set the action that encompasses the provided event. + * + * @param action the action value to set + * @return the EventContent object itself. + */ + public EventContent withAction(String action) { + this.action = action; + return this; + } + + /** + * Get the target of the event. + * + * @return the target value + */ + public Target target() { + return this.target; + } + + /** + * Set the target of the event. + * + * @param target the target value to set + * @return the EventContent object itself. + */ + public EventContent withTarget(Target target) { + this.target = target; + return this; + } + + /** + * Get the request that generated the event. + * + * @return the request value + */ + public Request request() { + return this.request; + } + + /** + * Set the request that generated the event. + * + * @param request the request value to set + * @return the EventContent object itself. + */ + public EventContent withRequest(Request request) { + this.request = request; + return this; + } + + /** + * Get the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @return the actor value + */ + public Actor actor() { + return this.actor; + } + + /** + * Set the agent that initiated the event. For most situations, this could be from the authorization context of the request. + * + * @param actor the actor value to set + * @return the EventContent object itself. + */ + public EventContent withActor(Actor actor) { + this.actor = actor; + return this; + } + + /** + * Get the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @return the source value + */ + public Source source() { + return this.source; + } + + /** + * Set the registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + * + * @param source the source value to set + * @return the EventContent object itself. + */ + public EventContent withSource(Source source) { + this.source = source; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventInfo.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventInfo.java new file mode 100644 index 0000000000000..c73f7e2051059 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventInfo.java @@ -0,0 +1,25 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.EventInfoInner; + +/** + * Type representing EventInfo. + */ +public interface EventInfo extends HasInner, HasManager { + /** + * @return the id value. + */ + String id(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventRequestMessage.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventRequestMessage.java new file mode 100644 index 0000000000000..ab78e5d3fe3b0 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventRequestMessage.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event request message sent to the service URI. + */ +public class EventRequestMessage { + /** + * The content of the event request message. + */ + @JsonProperty(value = "content") + private EventContent content; + + /** + * The headers of the event request message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The HTTP method used to send the event request message. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The URI used to send the event request message. + */ + @JsonProperty(value = "requestUri") + private String requestUri; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event request message. + * + * @return the content value + */ + public EventContent content() { + return this.content; + } + + /** + * Set the content of the event request message. + * + * @param content the content value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withContent(EventContent content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event request message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event request message. + * + * @param headers the headers value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the HTTP method used to send the event request message. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the HTTP method used to send the event request message. + * + * @param method the method value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the URI used to send the event request message. + * + * @return the requestUri value + */ + public String requestUri() { + return this.requestUri; + } + + /** + * Set the URI used to send the event request message. + * + * @param requestUri the requestUri value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withRequestUri(String requestUri) { + this.requestUri = requestUri; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventRequestMessage object itself. + */ + public EventRequestMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventResponseMessage.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventResponseMessage.java new file mode 100644 index 0000000000000..74043e72de640 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/EventResponseMessage.java @@ -0,0 +1,148 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event response message received from the service URI. + */ +public class EventResponseMessage { + /** + * The content of the event response message. + */ + @JsonProperty(value = "content") + private String content; + + /** + * The headers of the event response message. + */ + @JsonProperty(value = "headers") + private Map headers; + + /** + * The reason phrase of the event response message. + */ + @JsonProperty(value = "reasonPhrase") + private String reasonPhrase; + + /** + * The status code of the event response message. + */ + @JsonProperty(value = "statusCode") + private String statusCode; + + /** + * The HTTP message version. + */ + @JsonProperty(value = "version") + private String version; + + /** + * Get the content of the event response message. + * + * @return the content value + */ + public String content() { + return this.content; + } + + /** + * Set the content of the event response message. + * + * @param content the content value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withContent(String content) { + this.content = content; + return this; + } + + /** + * Get the headers of the event response message. + * + * @return the headers value + */ + public Map headers() { + return this.headers; + } + + /** + * Set the headers of the event response message. + * + * @param headers the headers value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withHeaders(Map headers) { + this.headers = headers; + return this; + } + + /** + * Get the reason phrase of the event response message. + * + * @return the reasonPhrase value + */ + public String reasonPhrase() { + return this.reasonPhrase; + } + + /** + * Set the reason phrase of the event response message. + * + * @param reasonPhrase the reasonPhrase value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withReasonPhrase(String reasonPhrase) { + this.reasonPhrase = reasonPhrase; + return this; + } + + /** + * Get the status code of the event response message. + * + * @return the statusCode value + */ + public String statusCode() { + return this.statusCode; + } + + /** + * Set the status code of the event response message. + * + * @param statusCode the statusCode value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withStatusCode(String statusCode) { + this.statusCode = statusCode; + return this; + } + + /** + * Get the HTTP message version. + * + * @return the version value + */ + public String version() { + return this.version; + } + + /** + * Set the HTTP message version. + * + * @param version the version value to set + * @return the EventResponseMessage object itself. + */ + public EventResponseMessage withVersion(String version) { + this.version = version; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/GitCommitTrigger.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/GitCommitTrigger.java new file mode 100644 index 0000000000000..8f14610902e7e --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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 unique ID of the trigger. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the unique ID of the trigger. + * + * @param id the id value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withId(String id) { + this.id = id; + return this; + } + + /** + * Get the unique ID that identifies a commit. + * + * @return the commitId value + */ + public String commitId() { + return this.commitId; + } + + /** + * Set the unique ID that identifies a commit. + * + * @param commitId the commitId value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withCommitId(String commitId) { + this.commitId = commitId; + return this; + } + + /** + * Get the repository URL. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the repository URL. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the branch name in the repository. + * + * @return the branchName value + */ + public String branchName() { + return this.branchName; + } + + /** + * Set the branch name in the repository. + * + * @param branchName the branchName value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withBranchName(String branchName) { + this.branchName = branchName; + return this; + } + + /** + * Get the source control provider type. + * + * @return the providerType value + */ + public String providerType() { + return this.providerType; + } + + /** + * Set the source control provider type. + * + * @param providerType the providerType value to set + * @return the GitCommitTrigger object itself. + */ + public GitCommitTrigger withProviderType(String providerType) { + this.providerType = providerType; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImageDescriptor.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImageDescriptor.java new file mode 100644 index 0000000000000..f646151ad74b2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImageDescriptor.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Properties for a registry image. + */ +public class ImageDescriptor { + /** + * The registry login server. + */ + @JsonProperty(value = "registry") + private String registry; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * The sha256-based digest of the image manifest. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * Get the registry login server. + * + * @return the registry value + */ + public String registry() { + return this.registry; + } + + /** + * Set the registry login server. + * + * @param registry the registry value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withRegistry(String registry) { + this.registry = registry; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withTag(String tag) { + this.tag = tag; + return this; + } + + /** + * Get the sha256-based digest of the image manifest. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the sha256-based digest of the image manifest. + * + * @param digest the digest value to set + * @return the ImageDescriptor object itself. + */ + public ImageDescriptor withDigest(String digest) { + this.digest = digest; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImageUpdateTrigger.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImageUpdateTrigger.java new file mode 100644 index 0000000000000..b5d6d3fa77b90 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImageUpdateTrigger.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import org.joda.time.DateTime; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The image update trigger that caused a build. + */ +public class ImageUpdateTrigger { + /** + * The unique ID of the trigger. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The timestamp when the image update happened. + */ + @JsonProperty(value = "timestamp") + private DateTime timestamp; + + /** + * The list of image updates that caused the build. + */ + @JsonProperty(value = "images") + private List images; + + /** + * Get the unique ID of the trigger. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the unique ID of the trigger. + * + * @param id the id value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withId(String id) { + this.id = id; + return this; + } + + /** + * Get the timestamp when the image update happened. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp when the image update happened. + * + * @param timestamp the timestamp value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Get the list of image updates that caused the build. + * + * @return the images value + */ + public List images() { + return this.images; + } + + /** + * Set the list of image updates that caused the build. + * + * @param images the images value to set + * @return the ImageUpdateTrigger object itself. + */ + public ImageUpdateTrigger withImages(List images) { + this.images = images; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportImageParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportImageParameters.java new file mode 100644 index 0000000000000..297829f75107e --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportImageParameters.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The ImportImageParameters model. + */ +public class ImportImageParameters { + /** + * The source of the image. + */ + @JsonProperty(value = "source", required = true) + private ImportSource source; + + /** + * List of strings of the form repo[:tag]. When tag is omitted the source + * will be used (or 'latest' if source tag is also omitted). + */ + @JsonProperty(value = "targetTags") + private List targetTags; + + /** + * List of strings of repository names to do a manifest only copy. No tag + * will be created. + */ + @JsonProperty(value = "untaggedTargetRepositories") + private List untaggedTargetRepositories; + + /** + * When Force, any existing target tags will be overwritten. When NoForce, + * any existing target tags will fail the operation before any copying + * begins. Possible values include: 'NoForce', 'Force'. + */ + @JsonProperty(value = "mode") + private ImportMode mode; + + /** + * Get the source of the image. + * + * @return the source value + */ + public ImportSource source() { + return this.source; + } + + /** + * Set the source of the image. + * + * @param source the source value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withSource(ImportSource source) { + this.source = source; + return this; + } + + /** + * Get list of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + * + * @return the targetTags value + */ + public List targetTags() { + return this.targetTags; + } + + /** + * Set list of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + * + * @param targetTags the targetTags value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withTargetTags(List targetTags) { + this.targetTags = targetTags; + return this; + } + + /** + * Get list of strings of repository names to do a manifest only copy. No tag will be created. + * + * @return the untaggedTargetRepositories value + */ + public List untaggedTargetRepositories() { + return this.untaggedTargetRepositories; + } + + /** + * Set list of strings of repository names to do a manifest only copy. No tag will be created. + * + * @param untaggedTargetRepositories the untaggedTargetRepositories value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withUntaggedTargetRepositories(List untaggedTargetRepositories) { + this.untaggedTargetRepositories = untaggedTargetRepositories; + return this; + } + + /** + * Get when Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'. + * + * @return the mode value + */ + public ImportMode mode() { + return this.mode; + } + + /** + * Set when Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'NoForce', 'Force'. + * + * @param mode the mode value to set + * @return the ImportImageParameters object itself. + */ + public ImportImageParameters withMode(ImportMode mode) { + this.mode = mode; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportMode.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportMode.java new file mode 100644 index 0000000000000..ed0e601eb02cc --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportMode.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ImportMode. + */ +public final class ImportMode extends ExpandableStringEnum { + /** Static value NoForce for ImportMode. */ + public static final ImportMode NO_FORCE = fromString("NoForce"); + + /** Static value Force for ImportMode. */ + public static final ImportMode FORCE = fromString("Force"); + + /** + * Creates or finds a ImportMode from its string representation. + * @param name a name to look for + * @return the corresponding ImportMode + */ + @JsonCreator + public static ImportMode fromString(String name) { + return fromString(name, ImportMode.class); + } + + /** + * @return known ImportMode values + */ + public static Collection values() { + return values(ImportMode.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportSource.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportSource.java new file mode 100644 index 0000000000000..81a6c6c96101e --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ImportSource.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +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 resource identifier of the target Azure Container Registry. + * + * @return the resourceId value + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Set the resource identifier of the target Azure Container Registry. + * + * @param resourceId the resourceId value to set + * @return the ImportSource object itself. + */ + public ImportSource withResourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * Get repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @return the sourceImage value + */ + public String sourceImage() { + return this.sourceImage; + } + + /** + * Set repository name of the source image. + Specify an image by repository ('hello-world'). This will use the 'latest' tag. + Specify an image by tag ('hello-world:latest'). + Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + * + * @param sourceImage the sourceImage value to set + * @return the ImportSource object itself. + */ + public ImportSource withSourceImage(String sourceImage) { + this.sourceImage = sourceImage; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OperationDefinition.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OperationDefinition.java new file mode 100644 index 0000000000000..924e98dc49a12 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OperationDefinition.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.OperationDefinitionInner; + +/** + * Type representing OperationDefinition. + */ +public interface OperationDefinition extends HasInner, HasManager { + /** + * @return the display value. + */ + OperationDisplayDefinition display(); + + /** + * @return the name value. + */ + String name(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OperationDisplayDefinition.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OperationDisplayDefinition.java new file mode 100644 index 0000000000000..3f20263503f30 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OperationDisplayDefinition.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The display information for a container registry operation. + */ +public class OperationDisplayDefinition { + /** + * The resource provider name: Microsoft.ContainerRegistry. + */ + @JsonProperty(value = "provider") + private String provider; + + /** + * The resource on which the operation is performed. + */ + @JsonProperty(value = "resource") + private String resource; + + /** + * The operation that users can perform. + */ + @JsonProperty(value = "operation") + private String operation; + + /** + * The description for the operation. + */ + @JsonProperty(value = "description") + private String description; + + /** + * Get the resource provider name: Microsoft.ContainerRegistry. + * + * @return the provider value + */ + public String provider() { + return this.provider; + } + + /** + * Set the resource provider name: Microsoft.ContainerRegistry. + * + * @param provider the provider value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withProvider(String provider) { + this.provider = provider; + return this; + } + + /** + * Get the resource on which the operation is performed. + * + * @return the resource value + */ + public String resource() { + return this.resource; + } + + /** + * Set the resource on which the operation is performed. + * + * @param resource the resource value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withResource(String resource) { + this.resource = resource; + return this; + } + + /** + * Get the operation that users can perform. + * + * @return the operation value + */ + public String operation() { + return this.operation; + } + + /** + * Set the operation that users can perform. + * + * @param operation the operation value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withOperation(String operation) { + this.operation = operation; + return this; + } + + /** + * Get the description for the operation. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description for the operation. + * + * @param description the description value to set + * @return the OperationDisplayDefinition object itself. + */ + public OperationDisplayDefinition withDescription(String description) { + this.description = description; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Operations.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Operations.java new file mode 100644 index 0000000000000..767caf46ba773 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Operations.java @@ -0,0 +1,27 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.OperationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Operations. + */ +public interface Operations extends HasInner { + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OsType.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/OsType.java new file mode 100644 index 0000000000000..4826f5e860963 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/PasswordName.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/PasswordName.java new file mode 100644 index 0000000000000..90c971db49114 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/PasswordName.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Defines values for PasswordName. + */ +public enum PasswordName { + /** Enum value password. */ + PASSWORD("password"), + + /** Enum value password2. */ + PASSWORD2("password2"); + + /** The actual serialized value for a PasswordName instance. */ + private String value; + + PasswordName(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a PasswordName instance. + * + * @param value the serialized value to parse. + * @return the parsed PasswordName object, or null if unable to parse. + */ + @JsonCreator + public static PasswordName fromString(String value) { + PasswordName[] items = PasswordName.values(); + for (PasswordName item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + @JsonValue + @Override + public String toString() { + return this.value; + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/PlatformProperties.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/PlatformProperties.java new file mode 100644 index 0000000000000..6be1d6431c477 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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 operating system type required for the build. Possible values include: 'Windows', 'Linux'. + * + * @return the osType value + */ + public OsType osType() { + return this.osType; + } + + /** + * Set the operating system type required for the build. Possible values include: 'Windows', 'Linux'. + * + * @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 configuration in terms of number of cores required for the build. + * + * @return the cpu value + */ + public Integer cpu() { + return this.cpu; + } + + /** + * Set the CPU configuration in terms of number of cores required for the build. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ProvisioningState.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ProvisioningState.java new file mode 100644 index 0000000000000..1df7829df8198 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ProvisioningState.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for ProvisioningState. + */ +public final class ProvisioningState extends ExpandableStringEnum { + /** Static value Creating for ProvisioningState. */ + public static final ProvisioningState CREATING = fromString("Creating"); + + /** Static value Updating for ProvisioningState. */ + public static final ProvisioningState UPDATING = fromString("Updating"); + + /** Static value Deleting for ProvisioningState. */ + public static final ProvisioningState DELETING = fromString("Deleting"); + + /** Static value Succeeded for ProvisioningState. */ + public static final ProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** Static value Failed for ProvisioningState. */ + public static final ProvisioningState FAILED = fromString("Failed"); + + /** Static value Canceled for ProvisioningState. */ + public static final ProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates or finds a ProvisioningState from its string representation. + * @param name a name to look for + * @return the corresponding ProvisioningState + */ + @JsonCreator + public static ProvisioningState fromString(String name) { + return fromString(name, ProvisioningState.class); + } + + /** + * @return known ProvisioningState values + */ + public static Collection values() { + return values(ProvisioningState.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/QueueBuildRequest.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/QueueBuildRequest.java new file mode 100644 index 0000000000000..d06a38bf47964 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/QueueBuildRequest.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.v2018_02_01_preview; + +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 QueueBuildRequest { +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/QuickBuildRequest.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/QuickBuildRequest.java new file mode 100644 index 0000000000000..4dbbefb40ffb5 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/QuickBuildRequest.java @@ -0,0 +1,239 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.BuildArgumentInner; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 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 QueueBuildRequest { + /** + * 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 fully qualified image names including the repository and tag. + * + * @return the imageNames value + */ + public List imageNames() { + return this.imageNames; + } + + /** + * Set the fully qualified image names including the repository and tag. + * + * @param imageNames the imageNames value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withImageNames(List imageNames) { + this.imageNames = imageNames; + return this; + } + + /** + * Get 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. + * + * @return the sourceLocation value + */ + public String sourceLocation() { + return this.sourceLocation; + } + + /** + * Set 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. + * + * @param sourceLocation the sourceLocation value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withSourceLocation(String sourceLocation) { + this.sourceLocation = sourceLocation; + return this; + } + + /** + * Get the collection of build arguments to be used. + * + * @return the buildArguments value + */ + public List buildArguments() { + return this.buildArguments; + } + + /** + * Set the collection of build arguments to be used. + * + * @param buildArguments the buildArguments value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withBuildArguments(List buildArguments) { + this.buildArguments = buildArguments; + return this; + } + + /** + * Get the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @return the isPushEnabled value + */ + public Boolean isPushEnabled() { + return this.isPushEnabled; + } + + /** + * Set the value of this property indicates whether the image built should be pushed to the registry or not. + * + * @param isPushEnabled the isPushEnabled value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withIsPushEnabled(Boolean isPushEnabled) { + this.isPushEnabled = isPushEnabled; + return this; + } + + /** + * Get the value of this property indicates whether the image cache is enabled or not. + * + * @return the noCache value + */ + public Boolean noCache() { + return this.noCache; + } + + /** + * Set the value of this property indicates whether the image cache is enabled or not. + * + * @param noCache the noCache value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withNoCache(Boolean noCache) { + this.noCache = noCache; + return this; + } + + /** + * Get build timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set build timeout in seconds. + * + * @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 properties against which the build will happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the build will happen. + * + * @param platform the platform value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the Docker file path relative to the source location. + * + * @return the dockerFilePath value + */ + public String dockerFilePath() { + return this.dockerFilePath; + } + + /** + * Set the Docker file path relative to the source location. + * + * @param dockerFilePath the dockerFilePath value to set + * @return the QuickBuildRequest object itself. + */ + public QuickBuildRequest withDockerFilePath(String dockerFilePath) { + this.dockerFilePath = dockerFilePath; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegenerateCredentialParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegenerateCredentialParameters.java new file mode 100644 index 0000000000000..cbcbbd31ea851 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegenerateCredentialParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters used to regenerate the login credential. + */ +public class RegenerateCredentialParameters { + /** + * Specifies name of the password which should be regenerated -- password + * or password2. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name", required = true) + private PasswordName name; + + /** + * Get specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegenerateCredentialParameters object itself. + */ + public RegenerateCredentialParameters withName(PasswordName name) { + this.name = name; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Registries.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Registries.java new file mode 100644 index 0000000000000..7c080aaf67aa2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Registries.java @@ -0,0 +1,98 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import com.microsoft.azure.arm.resources.collection.SupportsDeletingByResourceGroup; +import com.microsoft.azure.arm.resources.collection.SupportsBatchDeletion; +import com.microsoft.azure.arm.resources.collection.SupportsGettingByResourceGroup; +import rx.Observable; +import com.microsoft.azure.arm.resources.collection.SupportsListingByResourceGroup; +import com.microsoft.azure.arm.collection.SupportsListing; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.RegistriesInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Registries. + */ +public interface Registries extends SupportsCreating, SupportsDeletingByResourceGroup, SupportsBatchDeletion, SupportsGettingByResourceGroup, SupportsListingByResourceGroup, SupportsListing, HasInner { + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters); + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listCredentialsAsync(String resourceGroupName, String registryName); + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name); + + /** + * 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 + */ + Observable queueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequest buildRequest); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable checkNameAvailabilityAsync(String name); + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listUsagesAsync(String resourceGroupName, String registryName); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Registry.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Registry.java new file mode 100644 index 0000000000000..c4961e7c7c793 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Registry.java @@ -0,0 +1,164 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.Resource; +import com.microsoft.azure.arm.resources.models.GroupableResourceCore; +import com.microsoft.azure.arm.resources.models.HasResourceGroup; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.RegistryInner; + +/** + * Type representing Registry. + */ +public interface Registry extends HasInner, Resource, GroupableResourceCore, HasResourceGroup, Refreshable, Updatable, HasManager { + /** + * @return the adminUserEnabled value. + */ + Boolean adminUserEnabled(); + + /** + * @return the creationDate value. + */ + DateTime creationDate(); + + /** + * @return the loginServer value. + */ + String loginServer(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the sku value. + */ + Sku sku(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the storageAccount value. + */ + StorageAccountProperties storageAccount(); + + /** + * The entirety of the Registry definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithGroup, DefinitionStages.WithSku, DefinitionStages.WithCreate { + } + + /** + * Grouping of Registry definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Registry definition. + */ + interface Blank extends GroupableResourceCore.DefinitionWithRegion { + } + + /** + * The stage of the Registry definition allowing to specify the resource group. + */ + interface WithGroup extends GroupableResourceCore.DefinitionStages.WithGroup { + } + + /** + * The stage of the registry definition allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + WithCreate withSku(Sku sku); + } + + /** + * The stage of the registry update allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + WithCreate withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry update allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + WithCreate withStorageAccount(StorageAccountProperties storageAccount); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, Resource.DefinitionWithTags, DefinitionStages.WithAdminUserEnabled, DefinitionStages.WithStorageAccount { + } + } + /** + * The template for a Registry update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithAdminUserEnabled, UpdateStages.WithSku, UpdateStages.WithStorageAccount { + } + + /** + * Grouping of Registry update stages. + */ + interface UpdateStages { + /** + * The stage of the registry {0} allowing to specify AdminUserEnabled. + */ + interface WithAdminUserEnabled { + /** + * Specifies adminUserEnabled. + */ + Update withAdminUserEnabled(Boolean adminUserEnabled); + } + + /** + * The stage of the registry {0} allowing to specify Sku. + */ + interface WithSku { + /** + * Specifies sku. + */ + Update withSku(Sku sku); + } + + /** + * The stage of the registry {0} allowing to specify StorageAccount. + */ + interface WithStorageAccount { + /** + * Specifies storageAccount. + */ + Update withStorageAccount(StorageAccountProperties storageAccount); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryListCredentialsResult.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryListCredentialsResult.java new file mode 100644 index 0000000000000..620adff0987ce --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryListCredentialsResult.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.RegistryListCredentialsResultInner; +import java.util.List; + +/** + * Type representing RegistryListCredentialsResult. + */ +public interface RegistryListCredentialsResult extends HasInner, HasManager { + /** + * @return the passwords value. + */ + List passwords(); + + /** + * @return the username value. + */ + String username(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryNameCheckRequest.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryNameCheckRequest.java new file mode 100644 index 0000000000000..644d745579ee0 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryNameCheckRequest.java @@ -0,0 +1,78 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * A request to check whether a container registry name is available. + */ +public class RegistryNameCheckRequest { + /** + * The name of the container registry. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * The resource type of the container registry. This field must be set to + * 'Microsoft.ContainerRegistry/registries'. + */ + @JsonProperty(value = "type", required = true) + private String type; + + /** + * Creates an instance of RegistryNameCheckRequest class. + * @param name the name of the container registry. + */ + public RegistryNameCheckRequest() { + type = "Microsoft.ContainerRegistry/registries"; + } + + /** + * Get the name of the container registry. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the container registry. + * + * @param name the name value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withName(String name) { + this.name = name; + return this; + } + + /** + * Get the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + * + * @param type the type value to set + * @return the RegistryNameCheckRequest object itself. + */ + public RegistryNameCheckRequest withType(String type) { + this.type = type; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryNameStatus.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryNameStatus.java new file mode 100644 index 0000000000000..c4c95b19febb5 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryNameStatus.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.RegistryNameStatusInner; + +/** + * Type representing RegistryNameStatus. + */ +public interface RegistryNameStatus extends HasInner, HasManager { + /** + * @return the message value. + */ + String message(); + + /** + * @return the nameAvailable value. + */ + Boolean nameAvailable(); + + /** + * @return the reason value. + */ + String reason(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryPassword.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryPassword.java new file mode 100644 index 0000000000000..227254768d23e --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryPassword.java @@ -0,0 +1,69 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The login password for the container registry. + */ +public class RegistryPassword { + /** + * The password name. Possible values include: 'password', 'password2'. + */ + @JsonProperty(value = "name") + private PasswordName name; + + /** + * The password value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * Get the password name. Possible values include: 'password', 'password2'. + * + * @return the name value + */ + public PasswordName name() { + return this.name; + } + + /** + * Set the password name. Possible values include: 'password', 'password2'. + * + * @param name the name value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withName(PasswordName name) { + this.name = name; + return this; + } + + /** + * Get the password value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the password value. + * + * @param value the value value to set + * @return the RegistryPassword object itself. + */ + public RegistryPassword withValue(String value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUpdateParameters.java new file mode 100644 index 0000000000000..4365c94c85db3 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUpdateParameters.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a container registry. + */ +@JsonFlatten +public class RegistryUpdateParameters { + /** + * The tags for the container registry. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku") + private Sku sku; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The parameters of a storage account for the container registry. Only + * applicable to Classic SKU. If specified, the storage account must be in + * the same physical location as the container registry. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the tags for the container registry. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the container registry. + * + * @param tags the tags value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the parameters of a storage account for the container registry. Only applicable to Classic SKU. If specified, the storage account must be in the same physical location as the container registry. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the parameters of a storage account for the container registry. Only applicable to Classic SKU. If specified, the storage account must be in the same physical location as the container registry. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryUpdateParameters object itself. + */ + public RegistryUpdateParameters withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsage.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsage.java new file mode 100644 index 0000000000000..c81d8e167b8e7 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsage.java @@ -0,0 +1,121 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The quota usage for a container registry. + */ +public class RegistryUsage { + /** + * The name of the usage. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The limit of the usage. + */ + @JsonProperty(value = "limit") + private Long limit; + + /** + * The current value of the usage. + */ + @JsonProperty(value = "currentValue") + private Long currentValue; + + /** + * The unit of measurement. Possible values include: 'Count', 'Bytes'. + */ + @JsonProperty(value = "unit") + private RegistryUsageUnit unit; + + /** + * Get the name of the usage. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the usage. + * + * @param name the name value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withName(String name) { + this.name = name; + return this; + } + + /** + * Get the limit of the usage. + * + * @return the limit value + */ + public Long limit() { + return this.limit; + } + + /** + * Set the limit of the usage. + * + * @param limit the limit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Get the current value of the usage. + * + * @return the currentValue value + */ + public Long currentValue() { + return this.currentValue; + } + + /** + * Set the current value of the usage. + * + * @param currentValue the currentValue value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withCurrentValue(Long currentValue) { + this.currentValue = currentValue; + return this; + } + + /** + * Get the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @return the unit value + */ + public RegistryUsageUnit unit() { + return this.unit; + } + + /** + * Set the unit of measurement. Possible values include: 'Count', 'Bytes'. + * + * @param unit the unit value to set + * @return the RegistryUsage object itself. + */ + public RegistryUsage withUnit(RegistryUsageUnit unit) { + this.unit = unit; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsageListResult.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsageListResult.java new file mode 100644 index 0000000000000..06c921d6c4bc1 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsageListResult.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.RegistryUsageListResultInner; +import java.util.List; + +/** + * Type representing RegistryUsageListResult. + */ +public interface RegistryUsageListResult extends HasInner, HasManager { + /** + * @return the value value. + */ + List value(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsageUnit.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsageUnit.java new file mode 100644 index 0000000000000..a5f5f208d935b --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/RegistryUsageUnit.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for RegistryUsageUnit. + */ +public final class RegistryUsageUnit extends ExpandableStringEnum { + /** Static value Count for RegistryUsageUnit. */ + public static final RegistryUsageUnit COUNT = fromString("Count"); + + /** Static value Bytes for RegistryUsageUnit. */ + public static final RegistryUsageUnit BYTES = fromString("Bytes"); + + /** + * Creates or finds a RegistryUsageUnit from its string representation. + * @param name a name to look for + * @return the corresponding RegistryUsageUnit + */ + @JsonCreator + public static RegistryUsageUnit fromString(String name) { + return fromString(name, RegistryUsageUnit.class); + } + + /** + * @return known RegistryUsageUnit values + */ + public static Collection values() { + return values(RegistryUsageUnit.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Replication.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Replication.java new file mode 100644 index 0000000000000..5d9075e862467 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Replication.java @@ -0,0 +1,136 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ReplicationInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; + +/** + * Type representing Replication. + */ +public interface Replication extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the status value. + */ + Status status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Replication definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithLocation, DefinitionStages.WithCreate { + } + + /** + * Grouping of Replication definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Replication definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the replication definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + */ + WithLocation withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the replication definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithCreate withLocation(String location); + } + + /** + * The stage of the replication definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithTags { + } + } + /** + * The template for a Replication update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithTags { + } + + /** + * Grouping of Replication update stages. + */ + interface UpdateStages { + /** + * The stage of the replication update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ReplicationUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ReplicationUpdateParameters.java new file mode 100644 index 0000000000000..835bfaf5dc2b5 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/ReplicationUpdateParameters.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The parameters for updating a replication. + */ +public class ReplicationUpdateParameters { + /** + * The tags for the replication. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * Get the tags for the replication. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the replication. + * + * @param tags the tags value to set + * @return the ReplicationUpdateParameters object itself. + */ + public ReplicationUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Replications.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Replications.java new file mode 100644 index 0000000000000..4312c4bd18b07 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Replications.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ReplicationsInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Replications. + */ +public interface Replications extends SupportsCreating, HasInner { + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String replicationName); + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String replicationName); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Request.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Request.java new file mode 100644 index 0000000000000..7093da1af9062 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Request.java @@ -0,0 +1,150 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The request that generated the event. + */ +public class Request { + /** + * The ID of the request that initiated the event. + */ + @JsonProperty(value = "id") + private String id; + + /** + * The IP or hostname and possibly port of the client connection that + * initiated the event. This is the RemoteAddr from the standard http + * request. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The externally accessible hostname of the registry instance, as + * specified by the http host header on incoming requests. + */ + @JsonProperty(value = "host") + private String host; + + /** + * The request method that generated the event. + */ + @JsonProperty(value = "method") + private String method; + + /** + * The user agent header of the request. + */ + @JsonProperty(value = "useragent") + private String useragent; + + /** + * Get the ID of the request that initiated the event. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the ID of the request that initiated the event. + * + * @param id the id value to set + * @return the Request object itself. + */ + public Request withId(String id) { + this.id = id; + return this; + } + + /** + * Get the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + * + * @param addr the addr value to set + * @return the Request object itself. + */ + public Request withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @return the host value + */ + public String host() { + return this.host; + } + + /** + * Set the externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + * + * @param host the host value to set + * @return the Request object itself. + */ + public Request withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the request method that generated the event. + * + * @return the method value + */ + public String method() { + return this.method; + } + + /** + * Set the request method that generated the event. + * + * @param method the method value to set + * @return the Request object itself. + */ + public Request withMethod(String method) { + this.method = method; + return this; + } + + /** + * Get the user agent header of the request. + * + * @return the useragent value + */ + public String useragent() { + return this.useragent; + } + + /** + * Set the user agent header of the request. + * + * @param useragent the useragent value to set + * @return the Request object itself. + */ + public Request withUseragent(String useragent) { + this.useragent = useragent; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Sku.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Sku.java new file mode 100644 index 0000000000000..b4627e95c4d50 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Sku.java @@ -0,0 +1,60 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The SKU of a container registry. + */ +public class Sku { + /** + * The SKU name of the container registry. Required for registry creation. + * Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "name", required = true) + private SkuName name; + + /** + * The SKU tier based on the SKU name. Possible values include: 'Classic', + * 'Basic', 'Standard', 'Premium'. + */ + @JsonProperty(value = "tier", access = JsonProperty.Access.WRITE_ONLY) + private SkuTier tier; + + /** + * Get the SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @return the name value + */ + public SkuName name() { + return this.name; + } + + /** + * Set the SKU name of the container registry. Required for registry creation. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @param name the name value to set + * @return the Sku object itself. + */ + public Sku withName(SkuName name) { + this.name = name; + return this; + } + + /** + * Get the SKU tier based on the SKU name. Possible values include: 'Classic', 'Basic', 'Standard', 'Premium'. + * + * @return the tier value + */ + public SkuTier tier() { + return this.tier; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SkuName.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SkuName.java new file mode 100644 index 0000000000000..f4c855f5d342c --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SkuName.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuName. + */ +public final class SkuName extends ExpandableStringEnum { + /** Static value Classic for SkuName. */ + public static final SkuName CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuName. */ + public static final SkuName BASIC = fromString("Basic"); + + /** Static value Standard for SkuName. */ + public static final SkuName STANDARD = fromString("Standard"); + + /** Static value Premium for SkuName. */ + public static final SkuName PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuName from its string representation. + * @param name a name to look for + * @return the corresponding SkuName + */ + @JsonCreator + public static SkuName fromString(String name) { + return fromString(name, SkuName.class); + } + + /** + * @return known SkuName values + */ + public static Collection values() { + return values(SkuName.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SkuTier.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SkuTier.java new file mode 100644 index 0000000000000..3824399c5e9ad --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SkuTier.java @@ -0,0 +1,47 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SkuTier. + */ +public final class SkuTier extends ExpandableStringEnum { + /** Static value Classic for SkuTier. */ + public static final SkuTier CLASSIC = fromString("Classic"); + + /** Static value Basic for SkuTier. */ + public static final SkuTier BASIC = fromString("Basic"); + + /** Static value Standard for SkuTier. */ + public static final SkuTier STANDARD = fromString("Standard"); + + /** Static value Premium for SkuTier. */ + public static final SkuTier PREMIUM = fromString("Premium"); + + /** + * Creates or finds a SkuTier from its string representation. + * @param name a name to look for + * @return the corresponding SkuTier + */ + @JsonCreator + public static SkuTier fromString(String name) { + return fromString(name, SkuTier.class); + } + + /** + * @return known SkuTier values + */ + public static Collection values() { + return values(SkuTier.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Source.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Source.java new file mode 100644 index 0000000000000..4e71c10b4d1e2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Source.java @@ -0,0 +1,72 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The registry node that generated the event. Put differently, while the actor + * initiates the event, the source generates it. + */ +public class Source { + /** + * The IP or hostname and the port of the registry node that generated the + * event. Generally, this will be resolved by os.Hostname() along with the + * running port. + */ + @JsonProperty(value = "addr") + private String addr; + + /** + * The running instance of an application. Changes after each restart. + */ + @JsonProperty(value = "instanceID") + private String instanceID; + + /** + * Get the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @return the addr value + */ + public String addr() { + return this.addr; + } + + /** + * Set the IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + * + * @param addr the addr value to set + * @return the Source object itself. + */ + public Source withAddr(String addr) { + this.addr = addr; + return this; + } + + /** + * Get the running instance of an application. Changes after each restart. + * + * @return the instanceID value + */ + public String instanceID() { + return this.instanceID; + } + + /** + * Set the running instance of an application. Changes after each restart. + * + * @param instanceID the instanceID value to set + * @return the Source object itself. + */ + public Source withInstanceID(String instanceID) { + this.instanceID = instanceID; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceControlAuthInfo.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceControlAuthInfo.java new file mode 100644 index 0000000000000..892a4533e0219 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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 type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @return the tokenType value + */ + public TokenType tokenType() { + return this.tokenType; + } + + /** + * Set the type of Auth token. Possible values include: 'PAT', 'OAuth'. + * + * @param tokenType the tokenType value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withTokenType(TokenType tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get the access token used to access the source control provider. + * + * @return the token value + */ + public String token() { + return this.token; + } + + /** + * Set the access token used to access the source control provider. + * + * @param token the token value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withToken(String token) { + this.token = token; + return this; + } + + /** + * Get the refresh token used to refresh the access token. + * + * @return the refreshToken value + */ + public String refreshToken() { + return this.refreshToken; + } + + /** + * Set the refresh token used to refresh the access token. + * + * @param refreshToken the refreshToken value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get the scope of the access token. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of the access token. + * + * @param scope the scope value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get time in seconds that the token remains valid. + * + * @return the expiresIn value + */ + public Integer expiresIn() { + return this.expiresIn; + } + + /** + * Set time in seconds that the token remains valid. + * + * @param expiresIn the expiresIn value to set + * @return the SourceControlAuthInfo object itself. + */ + public SourceControlAuthInfo withExpiresIn(Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceControlType.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceControlType.java new file mode 100644 index 0000000000000..50f9c1ea6e6a4 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceControlType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for SourceControlType. + */ +public final class SourceControlType extends ExpandableStringEnum { + /** Static value Github for SourceControlType. */ + public static final SourceControlType GITHUB = fromString("Github"); + + /** Static value VisualStudioTeamService for SourceControlType. */ + public static final SourceControlType VISUAL_STUDIO_TEAM_SERVICE = fromString("VisualStudioTeamService"); + + /** + * Creates or finds a SourceControlType from its string representation. + * @param name a name to look for + * @return the corresponding SourceControlType + */ + @JsonCreator + public static SourceControlType fromString(String name) { + return fromString(name, SourceControlType.class); + } + + /** + * @return known SourceControlType values + */ + public static Collection values() { + return values(SourceControlType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceRepositoryProperties.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceRepositoryProperties.java new file mode 100644 index 0000000000000..ffdcc3b4c2bc8 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceRepositoryProperties.java @@ -0,0 +1,40 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.SourceRepositoryPropertiesInner; + +/** + * Type representing SourceRepositoryProperties. + */ +public interface SourceRepositoryProperties extends HasInner, HasManager { + /** + * @return the isCommitTriggerEnabled value. + */ + Boolean isCommitTriggerEnabled(); + + /** + * @return the repositoryUrl value. + */ + String repositoryUrl(); + + /** + * @return the sourceControlAuthProperties value. + */ + SourceControlAuthInfo sourceControlAuthProperties(); + + /** + * @return the sourceControlType value. + */ + SourceControlType sourceControlType(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceRepositoryUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceRepositoryUpdateParameters.java new file mode 100644 index 0000000000000..6b089f52070f2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview; + +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 authorization properties for accessing the source code repository. + * + * @return the sourceControlAuthProperties value + */ + public SourceControlAuthInfo sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the authorization properties for accessing the source code repository. + * + * @param sourceControlAuthProperties the sourceControlAuthProperties value to set + * @return the SourceRepositoryUpdateParameters object itself. + */ + public SourceRepositoryUpdateParameters withSourceControlAuthProperties(SourceControlAuthInfo sourceControlAuthProperties) { + this.sourceControlAuthProperties = sourceControlAuthProperties; + return this; + } + + /** + * Get the value of this property indicates whether the source control commit trigger is enabled or not. + * + * @return the isCommitTriggerEnabled value + */ + public Boolean isCommitTriggerEnabled() { + return this.isCommitTriggerEnabled; + } + + /** + * Set the value of this property indicates whether the source control commit trigger is enabled or not. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceUploadDefinition.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceUploadDefinition.java new file mode 100644 index 0000000000000..03fb31ee84c95 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/SourceUploadDefinition.java @@ -0,0 +1,30 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.SourceUploadDefinitionInner; + +/** + * Type representing SourceUploadDefinition. + */ +public interface SourceUploadDefinition extends HasInner, HasManager { + /** + * @return the relativePath value. + */ + String relativePath(); + + /** + * @return the uploadUrl value. + */ + String uploadUrl(); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Status.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Status.java new file mode 100644 index 0000000000000..35137675fcbd9 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Status.java @@ -0,0 +1,64 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The status of an Azure resource at the time the operation was called. + */ +public class Status { + /** + * The short label for the status. + */ + @JsonProperty(value = "displayStatus", access = JsonProperty.Access.WRITE_ONLY) + private String displayStatus; + + /** + * The detailed message for the status, including alerts and error + * messages. + */ + @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) + private String message; + + /** + * The timestamp when the status was changed to the current value. + */ + @JsonProperty(value = "timestamp", access = JsonProperty.Access.WRITE_ONLY) + private DateTime timestamp; + + /** + * Get the short label for the status. + * + * @return the displayStatus value + */ + public String displayStatus() { + return this.displayStatus; + } + + /** + * Get the detailed message for the status, including alerts and error messages. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Get the timestamp when the status was changed to the current value. + * + * @return the timestamp value + */ + public DateTime timestamp() { + return this.timestamp; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/StorageAccountProperties.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/StorageAccountProperties.java new file mode 100644 index 0000000000000..b4ec353cbd793 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/StorageAccountProperties.java @@ -0,0 +1,44 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a storage account for a container registry. Only + * applicable to Classic SKU. + */ +public class StorageAccountProperties { + /** + * The resource ID of the storage account. + */ + @JsonProperty(value = "id", required = true) + private String id; + + /** + * Get the resource ID of the storage account. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the resource ID of the storage account. + * + * @param id the id value to set + * @return the StorageAccountProperties object itself. + */ + public StorageAccountProperties withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Target.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Target.java new file mode 100644 index 0000000000000..af0b61f4dbe19 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Target.java @@ -0,0 +1,200 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The target of the event. + */ +public class Target { + /** + * The MIME type of the referenced object. + */ + @JsonProperty(value = "mediaType") + private String mediaType; + + /** + * The number of bytes of the content. Same as Length field. + */ + @JsonProperty(value = "size") + private Long size; + + /** + * The digest of the content, as defined by the Registry V2 HTTP API + * Specification. + */ + @JsonProperty(value = "digest") + private String digest; + + /** + * The number of bytes of the content. Same as Size field. + */ + @JsonProperty(value = "length") + private Long length; + + /** + * The repository name. + */ + @JsonProperty(value = "repository") + private String repository; + + /** + * The direct URL to the content. + */ + @JsonProperty(value = "url") + private String url; + + /** + * The tag name. + */ + @JsonProperty(value = "tag") + private String tag; + + /** + * Get the MIME type of the referenced object. + * + * @return the mediaType value + */ + public String mediaType() { + return this.mediaType; + } + + /** + * Set the MIME type of the referenced object. + * + * @param mediaType the mediaType value to set + * @return the Target object itself. + */ + public Target withMediaType(String mediaType) { + this.mediaType = mediaType; + return this; + } + + /** + * Get the number of bytes of the content. Same as Length field. + * + * @return the size value + */ + public Long size() { + return this.size; + } + + /** + * Set the number of bytes of the content. Same as Length field. + * + * @param size the size value to set + * @return the Target object itself. + */ + public Target withSize(Long size) { + this.size = size; + return this; + } + + /** + * Get the digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @return the digest value + */ + public String digest() { + return this.digest; + } + + /** + * Set the digest of the content, as defined by the Registry V2 HTTP API Specification. + * + * @param digest the digest value to set + * @return the Target object itself. + */ + public Target withDigest(String digest) { + this.digest = digest; + return this; + } + + /** + * Get the number of bytes of the content. Same as Size field. + * + * @return the length value + */ + public Long length() { + return this.length; + } + + /** + * Set the number of bytes of the content. Same as Size field. + * + * @param length the length value to set + * @return the Target object itself. + */ + public Target withLength(Long length) { + this.length = length; + return this; + } + + /** + * Get the repository name. + * + * @return the repository value + */ + public String repository() { + return this.repository; + } + + /** + * Set the repository name. + * + * @param repository the repository value to set + * @return the Target object itself. + */ + public Target withRepository(String repository) { + this.repository = repository; + return this; + } + + /** + * Get the direct URL to the content. + * + * @return the url value + */ + public String url() { + return this.url; + } + + /** + * Set the direct URL to the content. + * + * @param url the url value to set + * @return the Target object itself. + */ + public Target withUrl(String url) { + this.url = url; + return this; + } + + /** + * Get the tag name. + * + * @return the tag value + */ + public String tag() { + return this.tag; + } + + /** + * Set the tag name. + * + * @param tag the tag value to set + * @return the Target object itself. + */ + public Target withTag(String tag) { + this.tag = tag; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/TokenType.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/TokenType.java new file mode 100644 index 0000000000000..288d98d130223 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/TokenType.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for TokenType. + */ +public final class TokenType extends ExpandableStringEnum { + /** Static value PAT for TokenType. */ + public static final TokenType PAT = fromString("PAT"); + + /** Static value OAuth for TokenType. */ + public static final TokenType OAUTH = fromString("OAuth"); + + /** + * Creates or finds a TokenType from its string representation. + * @param name a name to look for + * @return the corresponding TokenType + */ + @JsonCreator + public static TokenType fromString(String name) { + return fromString(name, TokenType.class); + } + + /** + * @return known TokenType values + */ + public static Collection values() { + return values(TokenType.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Webhook.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Webhook.java new file mode 100644 index 0000000000000..968ce745f5fa5 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Webhook.java @@ -0,0 +1,247 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.model.HasInner; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.WebhookInner; +import com.microsoft.azure.arm.model.Indexable; +import com.microsoft.azure.arm.model.Refreshable; +import com.microsoft.azure.arm.model.Updatable; +import com.microsoft.azure.arm.model.Appliable; +import com.microsoft.azure.arm.model.Creatable; +import com.microsoft.azure.arm.resources.models.HasManager; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.ContainerRegistryManager; +import java.util.Map; +import java.util.List; + +/** + * Type representing Webhook. + */ +public interface Webhook extends HasInner, Indexable, Refreshable, Updatable, HasManager { + /** + * @return the actions value. + */ + List actions(); + + /** + * @return the id value. + */ + String id(); + + /** + * @return the location value. + */ + String location(); + + /** + * @return the name value. + */ + String name(); + + /** + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * @return the scope value. + */ + String scope(); + + /** + * @return the status value. + */ + WebhookStatus status(); + + /** + * @return the tags value. + */ + Map tags(); + + /** + * @return the type value. + */ + String type(); + + /** + * The entirety of the Webhook definition. + */ + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithRegistry, DefinitionStages.WithActions, DefinitionStages.WithLocation, DefinitionStages.WithServiceUri, DefinitionStages.WithCreate { + } + + /** + * Grouping of Webhook definition stages. + */ + interface DefinitionStages { + /** + * The first stage of a Webhook definition. + */ + interface Blank extends WithRegistry { + } + + /** + * The stage of the webhook definition allowing to specify Registry. + */ + interface WithRegistry { + /** + * Specifies resourceGroupName, registryName. + */ + WithActions withExistingRegistry(String resourceGroupName, String registryName); + } + + /** + * The stage of the webhook definition allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + */ + WithLocation withActions(List actions); + } + + /** + * The stage of the webhook definition allowing to specify Location. + */ + interface WithLocation { + /** + * Specifies location. + */ + WithServiceUri withLocation(String location); + } + + /** + * The stage of the webhook definition allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + */ + WithCreate withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook definition allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + */ + WithCreate withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook definition allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + */ + WithCreate withScope(String scope); + } + + /** + * The stage of the webhook definition allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + */ + WithCreate withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook definition allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + WithCreate withTags(Map tags); + } + + /** + * The stage of the definition which contains all the minimum required inputs for + * the resource to be created (via {@link WithCreate#create()}), but also allows + * for any other optional settings to be specified. + */ + interface WithCreate extends Creatable, DefinitionStages.WithCustomHeaders, DefinitionStages.WithScope, DefinitionStages.WithStatus, DefinitionStages.WithTags { + } + } + /** + * The template for a Webhook update operation, containing all the settings that can be modified. + */ + interface Update extends Appliable, UpdateStages.WithActions, UpdateStages.WithCustomHeaders, UpdateStages.WithScope, UpdateStages.WithServiceUri, UpdateStages.WithStatus, UpdateStages.WithTags { + } + + /** + * Grouping of Webhook update stages. + */ + interface UpdateStages { + /** + * The stage of the webhook update allowing to specify Actions. + */ + interface WithActions { + /** + * Specifies actions. + */ + Update withActions(List actions); + } + + /** + * The stage of the webhook update allowing to specify CustomHeaders. + */ + interface WithCustomHeaders { + /** + * Specifies customHeaders. + */ + Update withCustomHeaders(Map customHeaders); + } + + /** + * The stage of the webhook update allowing to specify Scope. + */ + interface WithScope { + /** + * Specifies scope. + */ + Update withScope(String scope); + } + + /** + * The stage of the webhook update allowing to specify ServiceUri. + */ + interface WithServiceUri { + /** + * Specifies serviceUri. + */ + Update withServiceUri(String serviceUri); + } + + /** + * The stage of the webhook update allowing to specify Status. + */ + interface WithStatus { + /** + * Specifies status. + */ + Update withStatus(WebhookStatus status); + } + + /** + * The stage of the webhook update allowing to specify Tags. + */ + interface WithTags { + /** + * Specifies tags. + */ + Update withTags(Map tags); + } + + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookAction.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookAction.java new file mode 100644 index 0000000000000..8558cc33ee205 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookAction.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.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookAction. + */ +public final class WebhookAction extends ExpandableStringEnum { + /** Static value push for WebhookAction. */ + public static final WebhookAction PUSH = fromString("push"); + + /** Static value delete for WebhookAction. */ + public static final WebhookAction DELETE = fromString("delete"); + + /** + * Creates or finds a WebhookAction from its string representation. + * @param name a name to look for + * @return the corresponding WebhookAction + */ + @JsonCreator + public static WebhookAction fromString(String name) { + return fromString(name, WebhookAction.class); + } + + /** + * @return known WebhookAction values + */ + public static Collection values() { + return values(WebhookAction.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookCreateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookCreateParameters.java new file mode 100644 index 0000000000000..72ca468730574 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookCreateParameters.java @@ -0,0 +1,208 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for creating a webhook. + */ +@JsonFlatten +public class WebhookCreateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The location of the webhook. This cannot be changed after the resource + * is created. + */ + @JsonProperty(value = "location", required = true) + private String location; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location of the webhook. This cannot be changed after the resource is created. + * + * @return the location value + */ + public String location() { + return this.location; + } + + /** + * Set the location of the webhook. This cannot be changed after the resource is created. + * + * @param location the location value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookCreateParameters object itself. + */ + public WebhookCreateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookStatus.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookStatus.java new file mode 100644 index 0000000000000..5a46829522d46 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookStatus.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Collection; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.microsoft.rest.ExpandableStringEnum; + +/** + * Defines values for WebhookStatus. + */ +public final class WebhookStatus extends ExpandableStringEnum { + /** Static value enabled for WebhookStatus. */ + public static final WebhookStatus ENABLED = fromString("enabled"); + + /** Static value disabled for WebhookStatus. */ + public static final WebhookStatus DISABLED = fromString("disabled"); + + /** + * Creates or finds a WebhookStatus from its string representation. + * @param name a name to look for + * @return the corresponding WebhookStatus + */ + @JsonCreator + public static WebhookStatus fromString(String name) { + return fromString(name, WebhookStatus.class); + } + + /** + * @return known WebhookStatus values + */ + public static Collection values() { + return values(WebhookStatus.class); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookUpdateParameters.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookUpdateParameters.java new file mode 100644 index 0000000000000..cc2ce0fb0eeca --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/WebhookUpdateParameters.java @@ -0,0 +1,181 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import java.util.Map; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The parameters for updating a webhook. + */ +@JsonFlatten +public class WebhookUpdateParameters { + /** + * The tags for the webhook. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "properties.serviceUri") + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "properties.customHeaders") + private Map customHeaders; + + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * Get the tags for the webhook. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags for the webhook. + * + * @param tags the tags value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookUpdateParameters object itself. + */ + public WebhookUpdateParameters withActions(List actions) { + this.actions = actions; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Webhooks.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Webhooks.java new file mode 100644 index 0000000000000..67d93831f0b1d --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/Webhooks.java @@ -0,0 +1,86 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview; + +import com.microsoft.azure.arm.collection.SupportsCreating; +import rx.Completable; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation.WebhooksInner; +import com.microsoft.azure.arm.model.HasInner; + +/** + * Type representing Webhooks. + */ +public interface Webhooks extends SupportsCreating, HasInner { + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable pingAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName); + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable getAsync(String resourceGroupName, String registryName, String webhookName); + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Observable listAsync(final String resourceGroupName, final String registryName); + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + Completable deleteAsync(String resourceGroupName, String registryName, String webhookName); + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildArgumentImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildArgumentImpl.java new file mode 100644 index 0000000000000..55149c49f3638 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildArgumentImpl.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildArgument; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class BuildArgumentImpl extends WrapperImpl implements BuildArgument { + private final ContainerRegistryManager manager; + BuildArgumentImpl(BuildArgumentInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Boolean isSecret() { + return this.inner().isSecret(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public String value() { + return this.inner().value(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildArgumentInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildArgumentInner.java new file mode 100644 index 0000000000000..2a169bb30af95 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildArgumentInner.java @@ -0,0 +1,131 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.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. + * @param name the name of the argument. + * @param value the value of the argument. + */ + public BuildArgumentInner() { + type = "DockerBuildArgument"; + } + + /** + * Get the type of the argument. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type of the argument. + * + * @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 of the argument. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name of the argument. + * + * @param name the name value to set + * @return the BuildArgumentInner object itself. + */ + public BuildArgumentInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the value of the argument. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value of the argument. + * + * @param value the value value to set + * @return the BuildArgumentInner object itself. + */ + public BuildArgumentInner withValue(String value) { + this.value = value; + return this; + } + + /** + * Get flag to indicate whether the argument represents a secret and want to be removed from build logs. + * + * @return the isSecret value + */ + public Boolean isSecret() { + return this.isSecret; + } + + /** + * Set flag to indicate whether the argument represents a secret and want to be removed from build logs. + * + * @param isSecret the isSecret value to set + * @return the BuildArgumentInner object itself. + */ + public BuildArgumentInner withIsSecret(Boolean isSecret) { + this.isSecret = isSecret; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildGetLogResultImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildGetLogResultImpl.java new file mode 100644 index 0000000000000..98d341cec33b8 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildGetLogResultImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildGetLogResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class BuildGetLogResultImpl extends WrapperImpl implements BuildGetLogResult { + private final ContainerRegistryManager manager; + BuildGetLogResultImpl(BuildGetLogResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String logLink() { + return this.inner().logLink(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildGetLogResultInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildGetLogResultInner.java new file mode 100644 index 0000000000000..9c47ad0fea232 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview.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 link to logs for a azure container registry build. + * + * @return the logLink value + */ + public String logLink() { + return this.logLink; + } + + /** + * Set the link to logs for a azure container registry build. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildImpl.java new file mode 100644 index 0000000000000..b3039c9dab97f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Build; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildType; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.GitCommitTrigger; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ImageUpdateTrigger; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ImageDescriptor; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStatus; + +class BuildImpl extends CreatableUpdatableImpl implements Build, Build.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String buildId; + + BuildImpl(String name, ContainerRegistryManager manager) { + super(name, new BuildInner()); + this.manager = manager; + // Set resource name + this.buildId = name; + // + } + + BuildImpl(BuildInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.buildId = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.buildId = IdParsingUtils.getValueFromIdByName(inner.id(), "builds"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BuildsInner client = this.manager().inner().builds(); + return null; // NOP createResourceAsync implementation as create is not supported + } + + @Override + public Observable updateResourceAsync() { + BuildsInner client = this.manager().inner().builds(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.buildId) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BuildsInner client = this.manager().inner().builds(); + return client.getAsync(this.resourceGroupName, this.registryName, this.buildId); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String buildId() { + return this.inner().buildId(); + } + + @Override + public String buildTask() { + return this.inner().buildTask(); + } + + @Override + public BuildType buildType() { + return this.inner().buildType(); + } + + @Override + public DateTime createTime() { + return this.inner().createTime(); + } + + @Override + public DateTime finishTime() { + return this.inner().finishTime(); + } + + @Override + public GitCommitTrigger gitCommitTrigger() { + return this.inner().gitCommitTrigger(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public ImageUpdateTrigger imageUpdateTrigger() { + return this.inner().imageUpdateTrigger(); + } + + @Override + public Boolean isArchiveEnabled() { + return this.inner().isArchiveEnabled(); + } + + @Override + public DateTime lastUpdatedTime() { + return this.inner().lastUpdatedTime(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public List outputImages() { + return this.inner().outputImages(); + } + + @Override + public PlatformProperties platform() { + return this.inner().platform(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public DateTime startTime() { + return this.inner().startTime(); + } + + @Override + public BuildStatus status() { + return this.inner().status(); + } + + @Override + public String type() { + return this.inner().type(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildInner.java new file mode 100644 index 0000000000000..f2064f33adfbc --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStatus; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildType; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ImageDescriptor; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ImageUpdateTrigger; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.GitCommitTrigger; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.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', 'Error', + * '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 unique identifier for the build. + * + * @return the buildId value + */ + public String buildId() { + return this.buildId; + } + + /** + * Set the unique identifier for the build. + * + * @param buildId the buildId value to set + * @return the BuildInner object itself. + */ + public BuildInner withBuildId(String buildId) { + this.buildId = buildId; + return this; + } + + /** + * Get the current status of the build. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @return the status value + */ + public BuildStatus status() { + return this.status; + } + + /** + * Set the current status of the build. Possible values include: 'Queued', 'Started', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Error', 'Timeout'. + * + * @param status the status value to set + * @return the BuildInner object itself. + */ + public BuildInner withStatus(BuildStatus status) { + this.status = status; + return this; + } + + /** + * Get the last updated time for the build. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + + /** + * Set the last updated time for the build. + * + * @param lastUpdatedTime the lastUpdatedTime value to set + * @return the BuildInner object itself. + */ + public BuildInner withLastUpdatedTime(DateTime lastUpdatedTime) { + this.lastUpdatedTime = lastUpdatedTime; + return this; + } + + /** + * Get the type of build. Possible values include: 'AutoBuild', 'QuickBuild'. + * + * @return the buildType value + */ + public BuildType buildType() { + return this.buildType; + } + + /** + * Set the type of build. Possible values include: 'AutoBuild', 'QuickBuild'. + * + * @param buildType the buildType value to set + * @return the BuildInner object itself. + */ + public BuildInner withBuildType(BuildType buildType) { + this.buildType = buildType; + return this; + } + + /** + * Get the time the build was created. + * + * @return the createTime value + */ + public DateTime createTime() { + return this.createTime; + } + + /** + * Set the time the build was created. + * + * @param createTime the createTime value to set + * @return the BuildInner object itself. + */ + public BuildInner withCreateTime(DateTime createTime) { + this.createTime = createTime; + return this; + } + + /** + * Get the time the build started. + * + * @return the startTime value + */ + public DateTime startTime() { + return this.startTime; + } + + /** + * Set the time the build started. + * + * @param startTime the startTime value to set + * @return the BuildInner object itself. + */ + public BuildInner withStartTime(DateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the time the build finished. + * + * @return the finishTime value + */ + public DateTime finishTime() { + return this.finishTime; + } + + /** + * Set the time the build finished. + * + * @param finishTime the finishTime value to set + * @return the BuildInner object itself. + */ + public BuildInner withFinishTime(DateTime finishTime) { + this.finishTime = finishTime; + return this; + } + + /** + * Get the list of all images that were generated from the build. + * + * @return the outputImages value + */ + public List outputImages() { + return this.outputImages; + } + + /** + * Set the list of all images that were generated from the build. + * + * @param outputImages the outputImages value to set + * @return the BuildInner object itself. + */ + public BuildInner withOutputImages(List outputImages) { + this.outputImages = outputImages; + return this; + } + + /** + * Get the build task with which the build was started. + * + * @return the buildTask value + */ + public String buildTask() { + return this.buildTask; + } + + /** + * Set the build task with which the build was started. + * + * @param buildTask the buildTask value to set + * @return the BuildInner object itself. + */ + public BuildInner withBuildTask(String buildTask) { + this.buildTask = buildTask; + return this; + } + + /** + * Get the image update trigger that caused the build. + * + * @return the imageUpdateTrigger value + */ + public ImageUpdateTrigger imageUpdateTrigger() { + return this.imageUpdateTrigger; + } + + /** + * Set the image update trigger that caused the build. + * + * @param imageUpdateTrigger the imageUpdateTrigger value to set + * @return the BuildInner object itself. + */ + public BuildInner withImageUpdateTrigger(ImageUpdateTrigger imageUpdateTrigger) { + this.imageUpdateTrigger = imageUpdateTrigger; + return this; + } + + /** + * Get the git commit trigger that caused the build. + * + * @return the gitCommitTrigger value + */ + public GitCommitTrigger gitCommitTrigger() { + return this.gitCommitTrigger; + } + + /** + * Set the git commit trigger that caused the build. + * + * @param gitCommitTrigger the gitCommitTrigger value to set + * @return the BuildInner object itself. + */ + public BuildInner withGitCommitTrigger(GitCommitTrigger gitCommitTrigger) { + this.gitCommitTrigger = gitCommitTrigger; + return this; + } + + /** + * Get the value that indicates whether archiving is enabled or not. + * + * @return the isArchiveEnabled value + */ + public Boolean isArchiveEnabled() { + return this.isArchiveEnabled; + } + + /** + * Set the value that indicates whether archiving is enabled or not. + * + * @param isArchiveEnabled the isArchiveEnabled value to set + * @return the BuildInner object itself. + */ + public BuildInner withIsArchiveEnabled(Boolean isArchiveEnabled) { + this.isArchiveEnabled = isArchiveEnabled; + return this; + } + + /** + * Get the platform properties against which the build will happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the build will happen. + * + * @param platform the platform value to set + * @return the BuildInner object itself. + */ + public BuildInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get the provisioning state of a build. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioning state of a build. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepImpl.java new file mode 100644 index 0000000000000..3a61da11e9c28 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepImpl.java @@ -0,0 +1,139 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStep; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStepUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStepProperties; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStepPropertiesUpdateParameters; +import rx.functions.Func1; + +class BuildStepImpl extends CreatableUpdatableImpl implements BuildStep, BuildStep.Definition, BuildStep.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String buildTaskName; + private String stepName; + private BuildStepUpdateParameters updateParameter; + + BuildStepImpl(String name, ContainerRegistryManager manager) { + super(name, new BuildStepInner()); + this.manager = manager; + // Set resource name + this.stepName = name; + // + this.updateParameter = new BuildStepUpdateParameters(); + } + + BuildStepImpl(BuildStepInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.stepName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.buildTaskName = IdParsingUtils.getValueFromIdByName(inner.id(), "buildTasks"); + this.stepName = IdParsingUtils.getValueFromIdByName(inner.id(), "steps"); + // + this.updateParameter = new BuildStepUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BuildStepsInner client = this.manager().inner().buildSteps(); + return client.createAsync(this.resourceGroupName, this.registryName, this.buildTaskName, this.stepName) + .map(new Func1() { + @Override + public BuildStepInner call(BuildStepInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BuildStepsInner client = this.manager().inner().buildSteps(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.buildTaskName, this.stepName, this.updateParameter) + .map(new Func1() { + @Override + public BuildStepInner call(BuildStepInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BuildStepsInner client = this.manager().inner().buildSteps(); + return client.getAsync(this.resourceGroupName, this.registryName, this.buildTaskName, this.stepName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new BuildStepUpdateParameters(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public BuildStepProperties properties() { + return this.inner().properties(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BuildStepImpl withExistingBuildTask(String resourceGroupName, String registryName, String buildTaskName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + this.buildTaskName = buildTaskName; + return this; + } + + @Override + public BuildStepImpl withProperties(BuildStepPropertiesUpdateParameters properties) { + this.updateParameter.withProperties(properties); + return this; + } + + @Override + public BuildStepImpl withTags(Map tags) { + this.updateParameter.withTags(tags); + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepInner.java new file mode 100644 index 0000000000000..98030d4ec26e4 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStepProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.ProxyResource; + +/** + * Build step resource properties. + */ +public class BuildStepInner extends ProxyResource { + /** + * The properties of a build step. + */ + @JsonProperty(value = "properties") + private BuildStepProperties properties; + + /** + * Get the properties of a build step. + * + * @return the properties value + */ + public BuildStepProperties properties() { + return this.properties; + } + + /** + * Set the properties of a build step. + * + * @param properties the properties value to set + * @return the BuildStepInner object itself. + */ + public BuildStepInner withProperties(BuildStepProperties properties) { + this.properties = properties; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsImpl.java new file mode 100644 index 0000000000000..fb77d60a02b4f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildSteps; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildArgument; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStep; + +class BuildStepsImpl extends WrapperImpl implements BuildSteps { + private final ContainerRegistryManager manager; + + BuildStepsImpl(ContainerRegistryManager manager) { + super(manager.inner().buildSteps()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public BuildStepImpl define(String name) { + return wrapModel(name); + } + + private BuildStepImpl wrapModel(BuildStepInner inner) { + return new BuildStepImpl(inner, manager()); + } + + private BuildStepImpl wrapModel(String name) { + return new BuildStepImpl(name, this.manager()); + } + + @Override + public Observable listBuildArgumentsAsync(final String resourceGroupName, final String registryName, final String buildTaskName, final String stepName) { + BuildStepsInner client = this.inner(); + return client.listBuildArgumentsAsync(resourceGroupName, registryName, buildTaskName, stepName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BuildArgument call(BuildArgumentInner inner) { + return new BuildArgumentImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName, final String buildTaskName) { + BuildStepsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName, buildTaskName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BuildStep call(BuildStepInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + BuildStepsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, buildTaskName, stepName) + .map(new Func1() { + @Override + public BuildStep call(BuildStepInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String buildTaskName, String stepName) { + BuildStepsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, buildTaskName, stepName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java new file mode 100644 index 0000000000000..a4afa95b51040 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildStepsInner.java @@ -0,0 +1,1445 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStepProperties; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildStepUpdateParameters; +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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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 BuildStepUpdateParameters 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.v2018_02_01_preview.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 BuildStepUpdateParameters 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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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 BuildStepProperties 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, BuildStepProperties 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, BuildStepProperties 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, BuildStepProperties 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, BuildStepProperties 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 BuildStepProperties 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, BuildStepProperties 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, BuildStepProperties 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, BuildStepProperties 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, BuildStepProperties 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, BuildStepUpdateParameters 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, BuildStepUpdateParameters 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, BuildStepUpdateParameters 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, BuildStepUpdateParameters 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, BuildStepUpdateParameters 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, BuildStepUpdateParameters 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, BuildStepUpdateParameters 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, BuildStepUpdateParameters 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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTaskImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTaskImpl.java new file mode 100644 index 0000000000000..8e19a4a27b630 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTaskImpl.java @@ -0,0 +1,241 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildTask; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildTaskUpdateParameters; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildTaskStatus; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.PlatformProperties; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceRepositoryProperties; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceRepositoryUpdateParameters; +import rx.functions.Func1; + +class BuildTaskImpl extends CreatableUpdatableImpl implements BuildTask, BuildTask.Definition, BuildTask.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String buildTaskName; + private BuildTaskUpdateParameters updateParameter; + + BuildTaskImpl(String name, ContainerRegistryManager manager) { + super(name, new BuildTaskInner()); + this.manager = manager; + // Set resource name + this.buildTaskName = name; + // + this.updateParameter = new BuildTaskUpdateParameters(); + } + + BuildTaskImpl(BuildTaskInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.buildTaskName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.buildTaskName = IdParsingUtils.getValueFromIdByName(inner.id(), "buildTasks"); + // + this.updateParameter = new BuildTaskUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + BuildTasksInner client = this.manager().inner().buildTasks(); + return client.createAsync(this.resourceGroupName, this.registryName, this.buildTaskName, this.inner()) + .map(new Func1() { + @Override + public BuildTaskInner call(BuildTaskInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + BuildTasksInner client = this.manager().inner().buildTasks(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.buildTaskName, this.updateParameter) + .map(new Func1() { + @Override + public BuildTaskInner call(BuildTaskInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + BuildTasksInner client = this.manager().inner().buildTasks(); + return client.getAsync(this.resourceGroupName, this.registryName, this.buildTaskName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new BuildTaskUpdateParameters(); + } + + @Override + public String alias() { + return this.inner().alias(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public PlatformProperties platform() { + return this.inner().platform(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public SourceRepositoryProperties sourceRepository() { + SourceRepositoryPropertiesInner inner = this.inner().sourceRepository(); + if (inner != null) { + return new SourceRepositoryPropertiesImpl(inner, manager()); + } else { + return null; + } + } + + @Override + public BuildTaskStatus status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public Integer timeout() { + return this.inner().timeout(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public BuildTaskImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public BuildTaskImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public BuildTaskImpl withSourceRepository(SourceRepositoryPropertiesInner sourceRepository) { + this.inner().withSourceRepository(sourceRepository); + return this; + } + + @Override + public BuildTaskImpl withSourceRepository(SourceRepositoryUpdateParameters sourceRepository) { + this.updateParameter.withSourceRepository(sourceRepository); + return this; + } + + @Override + public BuildTaskImpl withAlias(String alias) { + if (isInCreateMode()) { + this.inner().withAlias(alias); + } else { + this.updateParameter.withAlias(alias); + } + return this; + } + + @Override + public BuildTaskImpl withPlatform(PlatformProperties platform) { + if (isInCreateMode()) { + this.inner().withPlatform(platform); + } else { + this.updateParameter.withPlatform(platform); + } + return this; + } + + @Override + public BuildTaskImpl withStatus(BuildTaskStatus status) { + if (isInCreateMode()) { + this.inner().withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + + @Override + public BuildTaskImpl withTags(Map tags) { + if (isInCreateMode()) { + this.inner().withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + + @Override + public BuildTaskImpl withTimeout(Integer timeout) { + if (isInCreateMode()) { + this.inner().withTimeout(timeout); + } else { + this.updateParameter.withTimeout(timeout); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTaskInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTaskInner.java new file mode 100644 index 0000000000000..0e3dc83100e6f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildTaskStatus; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.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 provisioning state of the build task. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the creation date of build task. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the alternative updatable name for a build task. + * + * @return the alias value + */ + public String alias() { + return this.alias; + } + + /** + * Set the alternative updatable name for a build task. + * + * @param alias the alias value to set + * @return the BuildTaskInner object itself. + */ + public BuildTaskInner withAlias(String alias) { + this.alias = alias; + return this; + } + + /** + * Get the current status of build task. Possible values include: 'Disabled', 'Enabled'. + * + * @return the status value + */ + public BuildTaskStatus status() { + return this.status; + } + + /** + * Set the current status of build task. Possible values include: 'Disabled', 'Enabled'. + * + * @param status the status value to set + * @return the BuildTaskInner object itself. + */ + public BuildTaskInner withStatus(BuildTaskStatus status) { + this.status = status; + return this; + } + + /** + * Get the properties that describes the source(code) for the build task. + * + * @return the sourceRepository value + */ + public SourceRepositoryPropertiesInner sourceRepository() { + return this.sourceRepository; + } + + /** + * Set the properties that describes the source(code) for the build task. + * + * @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 properties against which the build has to happen. + * + * @return the platform value + */ + public PlatformProperties platform() { + return this.platform; + } + + /** + * Set the platform properties against which the build has to happen. + * + * @param platform the platform value to set + * @return the BuildTaskInner object itself. + */ + public BuildTaskInner withPlatform(PlatformProperties platform) { + this.platform = platform; + return this; + } + + /** + * Get build timeout in seconds. + * + * @return the timeout value + */ + public Integer timeout() { + return this.timeout; + } + + /** + * Set build timeout in seconds. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksImpl.java new file mode 100644 index 0000000000000..312dae91b16a0 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksImpl.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildTasks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceRepositoryProperties; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildTask; + +class BuildTasksImpl extends WrapperImpl implements BuildTasks { + private final ContainerRegistryManager manager; + + BuildTasksImpl(ContainerRegistryManager manager) { + super(manager.inner().buildTasks()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public BuildTaskImpl define(String name) { + return wrapModel(name); + } + + private BuildTaskImpl wrapModel(BuildTaskInner inner) { + return new BuildTaskImpl(inner, manager()); + } + + private BuildTaskImpl wrapModel(String name) { + return new BuildTaskImpl(name, this.manager()); + } + + @Override + public Observable listSourceRepositoryPropertiesAsync(String resourceGroupName, String registryName, String buildTaskName) { + BuildTasksInner client = this.inner(); + return client.listSourceRepositoryPropertiesAsync(resourceGroupName, registryName, buildTaskName) + .map(new Func1() { + @Override + public SourceRepositoryProperties call(SourceRepositoryPropertiesInner inner) { + return new SourceRepositoryPropertiesImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + BuildTasksInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public BuildTask call(BuildTaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String buildTaskName) { + BuildTasksInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, buildTaskName) + .map(new Func1() { + @Override + public BuildTask call(BuildTaskInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String buildTaskName) { + BuildTasksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, buildTaskName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java new file mode 100644 index 0000000000000..3c67ec63b97ab --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildTasksInner.java @@ -0,0 +1,1178 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildTaskUpdateParameters; +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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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 BuildTaskUpdateParameters 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.v2018_02_01_preview.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 BuildTaskUpdateParameters 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.v2018_02_01_preview.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.v2018_02_01_preview.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, BuildTaskUpdateParameters 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, BuildTaskUpdateParameters 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, BuildTaskUpdateParameters 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, BuildTaskUpdateParameters 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, BuildTaskUpdateParameters 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, BuildTaskUpdateParameters 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, BuildTaskUpdateParameters 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, BuildTaskUpdateParameters 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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsImpl.java new file mode 100644 index 0000000000000..f99df7ca3a7f2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsImpl.java @@ -0,0 +1,85 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Builds; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import rx.Completable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildGetLogResult; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Build; + +class BuildsImpl extends WrapperImpl implements Builds { + private final ContainerRegistryManager manager; + + BuildsImpl(ContainerRegistryManager manager) { + super(manager.inner().builds()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + private BuildImpl wrapModel(BuildInner inner) { + return new BuildImpl(inner, manager()); + } + + @Override + public Observable getLogLinkAsync(String resourceGroupName, String registryName, String buildId) { + BuildsInner client = this.inner(); + return client.getLogLinkAsync(resourceGroupName, registryName, buildId) + .map(new Func1() { + @Override + public BuildGetLogResult call(BuildGetLogResultInner inner) { + return new BuildGetLogResultImpl(inner, manager()); + } + }); + } + + @Override + public Completable cancelAsync(String resourceGroupName, String registryName, String buildId) { + BuildsInner client = this.inner(); + return client.cancelAsync(resourceGroupName, registryName, buildId).toCompletable(); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + BuildsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Build call(BuildInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String buildId) { + BuildsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, buildId) + .map(new Func1() { + @Override + public Build call(BuildInner inner) { + return wrapModel(inner); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/BuildsInner.java new file mode 100644 index 0000000000000..59b28cae28fd2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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.v2018_02_01_preview.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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/CallbackConfigImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/CallbackConfigImpl.java new file mode 100644 index 0000000000000..a7a410e379d25 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/CallbackConfigImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.CallbackConfig; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.Map; + +class CallbackConfigImpl extends WrapperImpl implements CallbackConfig { + private final ContainerRegistryManager manager; + CallbackConfigImpl(CallbackConfigInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Map customHeaders() { + return this.inner().customHeaders(); + } + + @Override + public String serviceUri() { + return this.inner().serviceUri(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/CallbackConfigInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/CallbackConfigInner.java new file mode 100644 index 0000000000000..ea7ccb9250aa5 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/CallbackConfigInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import java.util.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The configuration of service URI and custom headers for the webhook. + */ +public class CallbackConfigInner { + /** + * The service URI for the webhook to post notifications. + */ + @JsonProperty(value = "serviceUri", required = true) + private String serviceUri; + + /** + * Custom headers that will be added to the webhook notifications. + */ + @JsonProperty(value = "customHeaders") + private Map customHeaders; + + /** + * Get the service URI for the webhook to post notifications. + * + * @return the serviceUri value + */ + public String serviceUri() { + return this.serviceUri; + } + + /** + * Set the service URI for the webhook to post notifications. + * + * @param serviceUri the serviceUri value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withServiceUri(String serviceUri) { + this.serviceUri = serviceUri; + return this; + } + + /** + * Get custom headers that will be added to the webhook notifications. + * + * @return the customHeaders value + */ + public Map customHeaders() { + return this.customHeaders; + } + + /** + * Set custom headers that will be added to the webhook notifications. + * + * @param customHeaders the customHeaders value to set + * @return the CallbackConfigInner object itself. + */ + public CallbackConfigInner withCustomHeaders(Map customHeaders) { + this.customHeaders = customHeaders; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ContainerRegistryManagementClientImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ContainerRegistryManagementClientImpl.java new file mode 100644 index 0000000000000..35b76fc01305c --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ContainerRegistryManagementClientImpl.java @@ -0,0 +1,267 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.AzureClient; +import com.microsoft.azure.AzureServiceClient; +import com.microsoft.rest.credentials.ServiceClientCredentials; +import com.microsoft.rest.RestClient; + +/** + * Initializes a new instance of the ContainerRegistryManagementClientImpl class. + */ +public class ContainerRegistryManagementClientImpl extends AzureServiceClient { + /** the {@link AzureClient} used for long running operations. */ + private AzureClient azureClient; + + /** + * Gets the {@link AzureClient} used for long running operations. + * @return the azure client; + */ + public AzureClient getAzureClient() { + return this.azureClient; + } + + /** The Microsoft Azure subscription ID. */ + private String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withSubscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /** Gets or sets the preferred language for the response. */ + private String acceptLanguage; + + /** + * Gets Gets or sets the preferred language for the response. + * + * @return the acceptLanguage value. + */ + public String acceptLanguage() { + return this.acceptLanguage; + } + + /** + * Sets Gets or sets the preferred language for the response. + * + * @param acceptLanguage the acceptLanguage value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withAcceptLanguage(String acceptLanguage) { + this.acceptLanguage = acceptLanguage; + return this; + } + + /** Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. */ + private int longRunningOperationRetryTimeout; + + /** + * Gets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @return the longRunningOperationRetryTimeout value. + */ + public int longRunningOperationRetryTimeout() { + return this.longRunningOperationRetryTimeout; + } + + /** + * Sets Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. + * + * @param longRunningOperationRetryTimeout the longRunningOperationRetryTimeout value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withLongRunningOperationRetryTimeout(int longRunningOperationRetryTimeout) { + this.longRunningOperationRetryTimeout = longRunningOperationRetryTimeout; + return this; + } + + /** When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ + private boolean generateClientRequestId; + + /** + * Gets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @return the generateClientRequestId value. + */ + public boolean generateClientRequestId() { + return this.generateClientRequestId; + } + + /** + * Sets When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * + * @param generateClientRequestId the generateClientRequestId value. + * @return the service client itself + */ + public ContainerRegistryManagementClientImpl withGenerateClientRequestId(boolean generateClientRequestId) { + this.generateClientRequestId = generateClientRequestId; + return this; + } + + /** + * The RegistriesInner object to access its operations. + */ + private RegistriesInner registries; + + /** + * Gets the RegistriesInner object to access its operations. + * @return the RegistriesInner object. + */ + public RegistriesInner registries() { + return this.registries; + } + + /** + * The OperationsInner object to access its operations. + */ + private OperationsInner operations; + + /** + * Gets the OperationsInner object to access its operations. + * @return the OperationsInner object. + */ + public OperationsInner operations() { + return this.operations; + } + + /** + * The ReplicationsInner object to access its operations. + */ + private ReplicationsInner replications; + + /** + * Gets the ReplicationsInner object to access its operations. + * @return the ReplicationsInner object. + */ + public ReplicationsInner replications() { + return this.replications; + } + + /** + * The WebhooksInner object to access its operations. + */ + private WebhooksInner webhooks; + + /** + * Gets the WebhooksInner object to access its operations. + * @return the WebhooksInner object. + */ + public WebhooksInner webhooks() { + return this.webhooks; + } + + /** + * The 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. + * + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(ServiceClientCredentials credentials) { + this("https://management.azure.com", credentials); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param baseUrl the base URL of the host + * @param credentials the management credentials for Azure + */ + public ContainerRegistryManagementClientImpl(String baseUrl, ServiceClientCredentials credentials) { + super(baseUrl, credentials); + initialize(); + } + + /** + * Initializes an instance of ContainerRegistryManagementClient client. + * + * @param restClient the REST client to connect to Azure. + */ + public ContainerRegistryManagementClientImpl(RestClient restClient) { + super(restClient); + initialize(); + } + + protected void initialize() { + this.acceptLanguage = "en-US"; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.registries = new RegistriesInner(restClient().retrofit(), this); + this.operations = new OperationsInner(restClient().retrofit(), this); + this.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); + } + + /** + * Gets the User-Agent header for the client. + * + * @return the user agent string. + */ + @Override + public String userAgent() { + return String.format("%s (%s)", super.userAgent(), "ContainerRegistryManagementClient"); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ContainerRegistryManager.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ContainerRegistryManager.java new file mode 100644 index 0000000000000..b2118aae68e35 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ContainerRegistryManager.java @@ -0,0 +1,171 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.AzureEnvironment; +import com.microsoft.azure.AzureResponseBuilder; +import com.microsoft.azure.credentials.AzureTokenCredentials; +import com.microsoft.azure.management.apigeneration.Beta; +import com.microsoft.azure.management.apigeneration.Beta.SinceVersion; +import com.microsoft.azure.arm.resources.AzureConfigurable; +import com.microsoft.azure.serializer.AzureJacksonAdapter; +import com.microsoft.rest.RestClient; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Operations; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Builds; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildSteps; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.BuildTasks; +import com.microsoft.azure.arm.resources.implementation.AzureConfigurableCoreImpl; +import com.microsoft.azure.arm.resources.implementation.ManagerCore; + +/** + * Entry point to Azure ContainerRegistry resource management. + */ +public final class ContainerRegistryManager extends ManagerCore { + private Registries registries; + private Operations operations; + private Replications replications; + private Webhooks webhooks; + private Builds builds; + private BuildSteps buildSteps; + private BuildTasks buildTasks; + /** + * Get a Configurable instance that can be used to create ContainerRegistryManager with optional configuration. + * + * @return the instance allowing configurations + */ + public static Configurable configure() { + return new ContainerRegistryManager.ConfigurableImpl(); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return new ContainerRegistryManager(new RestClient.Builder() + .withBaseUrl(credentials.environment(), AzureEnvironment.Endpoint.RESOURCE_MANAGER) + .withCredentials(credentials) + .withSerializerAdapter(new AzureJacksonAdapter()) + .withResponseBuilderFactory(new AzureResponseBuilder.Factory()) + .build(), subscriptionId); + } + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry resource management API entry points. + * + * @param restClient the RestClient to be used for API calls. + * @param subscriptionId the subscription UUID + * @return the ContainerRegistryManager + */ + public static ContainerRegistryManager authenticate(RestClient restClient, String subscriptionId) { + return new ContainerRegistryManager(restClient, subscriptionId); + } + /** + * The interface allowing configurations to be set. + */ + public interface Configurable extends AzureConfigurable { + /** + * Creates an instance of ContainerRegistryManager that exposes ContainerRegistry management API entry points. + * + * @param credentials the credentials to use + * @param subscriptionId the subscription UUID + * @return the interface exposing ContainerRegistry management API entry points that work across subscriptions + */ + ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId); + } + + /** + * @return Entry point to manage Registries. + */ + public Registries registries() { + if (this.registries == null) { + this.registries = new RegistriesImpl(this); + } + return this.registries; + } + + /** + * @return Entry point to manage Operations. + */ + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(this); + } + return this.operations; + } + + /** + * @return Entry point to manage Replications. + */ + public Replications replications() { + if (this.replications == null) { + this.replications = new ReplicationsImpl(this); + } + return this.replications; + } + + /** + * @return Entry point to manage Webhooks. + */ + public Webhooks webhooks() { + if (this.webhooks == null) { + this.webhooks = new WebhooksImpl(this); + } + return this.webhooks; + } + + /** + * @return Entry point to manage Builds. + */ + public Builds builds() { + if (this.builds == null) { + this.builds = new BuildsImpl(this); + } + return this.builds; + } + + /** + * @return Entry point to manage BuildSteps. + */ + public BuildSteps buildSteps() { + if (this.buildSteps == null) { + this.buildSteps = new BuildStepsImpl(this); + } + return this.buildSteps; + } + + /** + * @return Entry point to manage BuildTasks. + */ + public BuildTasks buildTasks() { + if (this.buildTasks == null) { + this.buildTasks = new BuildTasksImpl(this); + } + return this.buildTasks; + } + + /** + * The implementation for Configurable interface. + */ + private static final class ConfigurableImpl extends AzureConfigurableCoreImpl implements Configurable { + public ContainerRegistryManager authenticate(AzureTokenCredentials credentials, String subscriptionId) { + return ContainerRegistryManager.authenticate(buildRestClient(credentials), subscriptionId); + } + } + private ContainerRegistryManager(RestClient restClient, String subscriptionId) { + super( + restClient, + subscriptionId, + new ContainerRegistryManagementClientImpl(restClient).withSubscriptionId(subscriptionId)); + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventImpl.java new file mode 100644 index 0000000000000..ecfdcc6acf82f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Event; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.EventResponseMessage; + +class EventImpl extends WrapperImpl implements Event { + private final ContainerRegistryManager manager; + EventImpl(EventInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public EventRequestMessage eventRequestMessage() { + return this.inner().eventRequestMessage(); + } + + @Override + public EventResponseMessage eventResponseMessage() { + return this.inner().eventResponseMessage(); + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInfoImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInfoImpl.java new file mode 100644 index 0000000000000..26dabe8e2b248 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInfoImpl.java @@ -0,0 +1,31 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.EventInfo; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class EventInfoImpl extends WrapperImpl implements EventInfo { + private final ContainerRegistryManager manager; + EventInfoImpl(EventInfoInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String id() { + return this.inner().id(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInfoInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInfoInner.java new file mode 100644 index 0000000000000..8893cf1fe698f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInfoInner.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The basic information of an event. + */ +public class EventInfoInner { + /** + * The event ID. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Get the event ID. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the event ID. + * + * @param id the id value to set + * @return the EventInfoInner object itself. + */ + public EventInfoInner withId(String id) { + this.id = id; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInner.java new file mode 100644 index 0000000000000..959ae3530e1fa --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/EventInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.EventRequestMessage; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.EventResponseMessage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The event for a webhook. + */ +public class EventInner extends EventInfoInner { + /** + * The event request message sent to the service URI. + */ + @JsonProperty(value = "eventRequestMessage") + private EventRequestMessage eventRequestMessage; + + /** + * The event response message received from the service URI. + */ + @JsonProperty(value = "eventResponseMessage") + private EventResponseMessage eventResponseMessage; + + /** + * Get the event request message sent to the service URI. + * + * @return the eventRequestMessage value + */ + public EventRequestMessage eventRequestMessage() { + return this.eventRequestMessage; + } + + /** + * Set the event request message sent to the service URI. + * + * @param eventRequestMessage the eventRequestMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventRequestMessage(EventRequestMessage eventRequestMessage) { + this.eventRequestMessage = eventRequestMessage; + return this; + } + + /** + * Get the event response message received from the service URI. + * + * @return the eventResponseMessage value + */ + public EventResponseMessage eventResponseMessage() { + return this.eventResponseMessage; + } + + /** + * Set the event response message received from the service URI. + * + * @param eventResponseMessage the eventResponseMessage value to set + * @return the EventInner object itself. + */ + public EventInner withEventResponseMessage(EventResponseMessage eventResponseMessage) { + this.eventResponseMessage = eventResponseMessage; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/IdParsingUtils.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/IdParsingUtils.java new file mode 100644 index 0000000000000..393f3a8bb8acd --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/IdParsingUtils.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; +import java.util.Arrays; +import java.util.Iterator; + +class IdParsingUtils { + public static String getValueFromIdByName(String id, String name) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (part.equalsIgnoreCase(name)) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + } + return null; + } + + public static String getValueFromIdByPosition(String id, int pos) { + if (id == null) { + return null; + } + Iterable iterable = Arrays.asList(id.split("/")); + Iterator itr = iterable.iterator(); + int index = 0; + while (itr.hasNext()) { + String part = itr.next(); + if (part != null && part.trim() != "") { + if (index == pos) { + if (itr.hasNext()) { + return itr.next(); + } else { + return null; + } + } + } + index++; + } + return null; + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationDefinitionImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationDefinitionImpl.java new file mode 100644 index 0000000000000..f4f6cb9479a59 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationDefinitionImpl.java @@ -0,0 +1,37 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.OperationDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.OperationDisplayDefinition; + +class OperationDefinitionImpl extends WrapperImpl implements OperationDefinition { + private final ContainerRegistryManager manager; + OperationDefinitionImpl(OperationDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public OperationDisplayDefinition display() { + return this.inner().display(); + } + + @Override + public String name() { + return this.inner().name(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationDefinitionInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationDefinitionInner.java new file mode 100644 index 0000000000000..ce4cb9ee0c55e --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationDefinitionInner.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.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.OperationDisplayDefinition; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The definition of a container registry operation. + */ +public class OperationDefinitionInner { + /** + * Operation name: {provider}/{resource}/{operation}. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The display information for the container registry operation. + */ + @JsonProperty(value = "display") + private OperationDisplayDefinition display; + + /** + * Get operation name: {provider}/{resource}/{operation}. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the display information for the container registry operation. + * + * @return the display value + */ + public OperationDisplayDefinition display() { + return this.display; + } + + /** + * Set the display information for the container registry operation. + * + * @param display the display value to set + * @return the OperationDefinitionInner object itself. + */ + public OperationDefinitionInner withDisplay(OperationDisplayDefinition display) { + this.display = display; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationsImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationsImpl.java new file mode 100644 index 0000000000000..5cd355be039bd --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationsImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * abc + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Operations; +import rx.functions.Func1; +import rx.Observable; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.OperationDefinition; + +class OperationsImpl extends WrapperImpl implements Operations { + private final ContainerRegistryManager manager; + + OperationsImpl(ContainerRegistryManager manager) { + super(manager.inner().operations()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable listAsync() { + OperationsInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public OperationDefinition call(OperationDefinitionInner inner) { + return new OperationDefinitionImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationsInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationsInner.java new file mode 100644 index 0000000000000..4999d2219d90b --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/OperationsInner.java @@ -0,0 +1,281 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Operations. + */ +public class OperationsInner { + /** The Retrofit service to perform REST calls. */ + private OperationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of OperationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public OperationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(OperationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Operations to be + * used by Retrofit to perform actually REST calls. + */ + interface OperationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Operations list" }) + @GET("providers/Microsoft.ContainerRegistry/operations") + Observable> list(@Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Operations listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + final String apiVersion = "2017-10-01"; + return service.list(apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<OperationDefinitionInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<OperationDefinitionInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all of the available Azure Container Registry REST API operations. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<OperationDefinitionInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/PageImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/PageImpl.java new file mode 100644 index 0000000000000..e27c54b08cfed --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/PageImpl.java @@ -0,0 +1,75 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.azure.Page; +import java.util.List; + +/** + * An instance of this class defines a page of Azure resources and a link to + * get the next page of resources, if any. + * + * @param type of Azure resource + */ +public class PageImpl implements Page { + /** + * The link to the next page. + */ + @JsonProperty("nextLink") + private String nextPageLink; + + /** + * The list of items. + */ + @JsonProperty("value") + private List items; + + /** + * Gets the link to the next page. + * + * @return the link to the next page. + */ + @Override + public String nextPageLink() { + return this.nextPageLink; + } + + /** + * Gets the list of items. + * + * @return the list of items in {@link List}. + */ + @Override + public List items() { + return items; + } + + /** + * Sets the link to the next page. + * + * @param nextPageLink the link to the next page. + * @return this Page object itself. + */ + public PageImpl setNextPageLink(String nextPageLink) { + this.nextPageLink = nextPageLink; + return this; + } + + /** + * Sets the list of items. + * + * @param items the list of items in {@link List}. + * @return this Page object itself. + */ + public PageImpl setItems(List items) { + this.items = items; + return this; + } +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesImpl.java new file mode 100644 index 0000000000000..01e6d0fda2659 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesImpl.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * def + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.collection.implementation.GroupableResourcesCoreImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registry; +import rx.Observable; +import rx.Completable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import com.microsoft.azure.arm.resources.ResourceUtilsCore; +import com.microsoft.azure.arm.utils.RXMapper; +import rx.functions.Func1; +import com.microsoft.azure.PagedList; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryListCredentialsResult; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Build; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceUploadDefinition; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryNameStatus; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ImportImageParameters; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.PasswordName; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.QueueBuildRequest; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryUsageListResult; + +class RegistriesImpl extends GroupableResourcesCoreImpl implements Registries { + protected RegistriesImpl(ContainerRegistryManager manager) { + super(manager.inner().registries(), manager); + } + + @Override + protected Observable getInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.getByResourceGroupAsync(resourceGroupName, name); + } + + @Override + protected Completable deleteInnerAsync(String resourceGroupName, String name) { + RegistriesInner client = this.inner(); + return client.deleteAsync(resourceGroupName, name).toCompletable(); + } + + @Override + public Observable deleteByIdsAsync(Collection ids) { + if (ids == null || ids.isEmpty()) { + return Observable.empty(); + } + Collection> observables = new ArrayList<>(); + for (String id : ids) { + final String resourceGroupName = ResourceUtilsCore.groupFromResourceId(id); + final String name = ResourceUtilsCore.nameFromResourceId(id); + Observable o = RXMapper.map(this.inner().deleteAsync(resourceGroupName, name), id); + observables.add(o); + } + return Observable.mergeDelayError(observables); + } + + @Override + public Observable deleteByIdsAsync(String...ids) { + return this.deleteByIdsAsync(new ArrayList(Arrays.asList(ids))); + } + + @Override + public void deleteByIds(Collection ids) { + if (ids != null && !ids.isEmpty()) { + this.deleteByIdsAsync(ids).toBlocking().last(); + } + } + + @Override + public void deleteByIds(String...ids) { + this.deleteByIds(new ArrayList(Arrays.asList(ids))); + } + + @Override + public PagedList listByResourceGroup(String resourceGroupName) { + RegistriesInner client = this.inner(); + return this.wrapList(client.listByResourceGroup(resourceGroupName)); + } + + @Override + public Observable listByResourceGroupAsync(String resourceGroupName) { + RegistriesInner client = this.inner(); + return client.listByResourceGroupAsync(resourceGroupName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public PagedList list() { + RegistriesInner client = this.inner(); + return this.wrapList(client.list()); + } + + @Override + public Observable listAsync() { + RegistriesInner client = this.inner(); + return client.listAsync() + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Registry call(RegistryInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public RegistryImpl define(String name) { + return wrapModel(name); + } + + @Override + public Completable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + RegistriesInner client = this.inner(); + return client.importImageAsync(resourceGroupName, registryName, parameters).toCompletable(); + } + + @Override + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listCredentialsAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + RegistriesInner client = this.inner(); + return client.regenerateCredentialAsync(resourceGroupName, registryName, name) + .map(new Func1() { + @Override + public RegistryListCredentialsResult call(RegistryListCredentialsResultInner inner) { + return new RegistryListCredentialsResultImpl(inner, manager()); + } + }); + } + + @Override + public Observable queueBuildAsync(String resourceGroupName, String registryName, QueueBuildRequest buildRequest) { + RegistriesInner client = this.inner(); + return client.queueBuildAsync(resourceGroupName, registryName, buildRequest) + .map(new Func1() { + @Override + public Build call(BuildInner inner) { + return new BuildImpl(inner, manager()); + } + }); + } + + @Override + public Observable getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.getBuildSourceUploadUrlAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public SourceUploadDefinition call(SourceUploadDefinitionInner inner) { + return new SourceUploadDefinitionImpl(inner, manager()); + } + }); + } + + @Override + public Observable checkNameAvailabilityAsync(String name) { + RegistriesInner client = this.inner(); + return client.checkNameAvailabilityAsync(name) + .map(new Func1() { + @Override + public RegistryNameStatus call(RegistryNameStatusInner inner) { + return new RegistryNameStatusImpl(inner, manager()); + } + }); + } + + @Override + protected RegistryImpl wrapModel(RegistryInner inner) { + return new RegistryImpl(inner.name(), inner, manager()); + } + + @Override + protected RegistryImpl wrapModel(String name) { + return new RegistryImpl(name, new RegistryInner(), this.manager()); + } + + @Override + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + RegistriesInner client = this.inner(); + return client.listUsagesAsync(resourceGroupName, registryName) + .map(new Func1() { + @Override + public RegistryUsageListResult call(RegistryUsageListResultInner inner) { + return new RegistryUsageListResultImpl(inner, manager()); + } + }); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java new file mode 100644 index 0000000000000..bb416086d6397 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistriesInner.java @@ -0,0 +1,1926 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.collection.InnerSupportsGet; +import com.microsoft.azure.arm.collection.InnerSupportsDelete; +import com.microsoft.azure.arm.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ImportImageParameters; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.PasswordName; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.QueueBuildRequest; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegenerateCredentialParameters; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryNameCheckRequest; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Registries. + */ +public class RegistriesInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private RegistriesService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of RegistriesInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public RegistriesInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(RegistriesService.class); + this.client = client; + } + + /** + * The interface defining all the services for Registries to be + * used by Retrofit to perform actually REST calls. + */ + interface RegistriesService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries importImage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage") + Observable> importImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body ImportImageParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries beginImportImage" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage") + Observable> beginImportImage(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body ImportImageParameters parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries checkNameAvailability" }) + @POST("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability") + Observable> checkNameAvailability(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegistryNameCheckRequest registryNameCheckRequest, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryInner registry, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Body RegistryUpdateParameters registryUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries listCredentials" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials") + Observable> listCredentials(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries regenerateCredential" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential") + Observable> regenerateCredential(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body RegenerateCredentialParameters regenerateCredentialParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries listUsages" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages") + Observable> listUsages(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.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 QueueBuildRequest 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.v2018_02_01_preview.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 QueueBuildRequest 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.v2018_02_01_preview.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.v2018_02_01_preview.Registries listByResourceGroupNext" }) + @GET + Observable> listByResourceGroupNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registries listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void importImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().last().body(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters), serviceCallback); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable importImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + return importImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> importImageWithServiceResponseAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01"; + Observable> observable = service.importImage(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()); + return client.getAzureClient().getPostOrDeleteResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginImportImage(String resourceGroupName, String registryName, ImportImageParameters parameters) { + beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).toBlocking().single().body(); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginImportImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters), serviceCallback); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginImportImageAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + return beginImportImageWithServiceResponseAsync(resourceGroupName, registryName, parameters).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Copies an image to this container registry from the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param parameters The parameters specifying the image to copy and the source container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginImportImageWithServiceResponseAsync(String resourceGroupName, String registryName, ImportImageParameters parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2017-10-01"; + return service.beginImportImage(this.client.subscriptionId(), resourceGroupName, registryName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginImportImageDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginImportImageDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryNameStatusInner object if successful. + */ + public RegistryNameStatusInner checkNameAvailability(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).toBlocking().single().body(); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture checkNameAvailabilityAsync(String name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(checkNameAvailabilityWithServiceResponseAsync(name), serviceCallback); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable checkNameAvailabilityAsync(String name) { + return checkNameAvailabilityWithServiceResponseAsync(name).map(new Func1, RegistryNameStatusInner>() { + @Override + public RegistryNameStatusInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Checks whether the container registry name is available for use. The name must contain only alphanumeric characters, be globally unique, and between 5 and 50 characters in length. + * + * @param name The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryNameStatusInner object + */ + public Observable> checkNameAvailabilityWithServiceResponseAsync(String name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + RegistryNameCheckRequest registryNameCheckRequest = new RegistryNameCheckRequest(); + registryNameCheckRequest.withName(name); + return service.checkNameAvailability(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), registryNameCheckRequest, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = checkNameAvailabilityDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse checkNameAvailabilityDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner getByResourceGroup(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String registryName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner create(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().last().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return createWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registry == null) { + throw new IllegalArgumentException("Parameter registry is required and cannot be null."); + } + Validator.validate(registry); + final String apiVersion = "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()); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginCreate(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).toBlocking().single().body(); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry), serviceCallback); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, RegistryInner registry) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, registry).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registry The parameters for creating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryInner registry) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registry == null) { + throw new IllegalArgumentException("Parameter registry is required and cannot be null."); + } + Validator.validate(registry); + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().last().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "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()); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner update(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registryUpdateParameters == null) { + throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); + } + Validator.validate(registryUpdateParameters); + final String apiVersion = "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()); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryInner object if successful. + */ + public RegistryInner beginUpdate(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters), serviceCallback); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, registryUpdateParameters).map(new Func1, RegistryInner>() { + @Override + public RegistryInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param registryUpdateParameters The parameters for updating a container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, RegistryUpdateParameters registryUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (registryUpdateParameters == null) { + throw new IllegalArgumentException("Parameter registryUpdateParameters is required and cannot be null."); + } + Validator.validate(registryUpdateParameters); + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroup(final String resourceGroupName) { + ServiceResponse> response = listByResourceGroupSinglePageAsync(resourceGroupName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(final String resourceGroupName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupSinglePageAsync(resourceGroupName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupAsync(final String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(final String resourceGroupName) { + return listByResourceGroupSinglePageAsync(resourceGroupName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupSinglePageAsync(final String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList list() { + ServiceResponse> response = listSinglePageAsync().toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync() + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listWithServiceResponseAsync() { + return listSinglePageAsync() + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner listCredentials(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listCredentialsAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listCredentialsWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable listCredentialsAsync(String resourceGroupName, String registryName) { + return listCredentialsWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Lists the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> listCredentialsWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = listCredentialsDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listCredentialsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryListCredentialsResultInner object if successful. + */ + public RegistryListCredentialsResultInner regenerateCredential(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).toBlocking().single().body(); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name), serviceCallback); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable regenerateCredentialAsync(String resourceGroupName, String registryName, PasswordName name) { + return regenerateCredentialWithServiceResponseAsync(resourceGroupName, registryName, name).map(new Func1, RegistryListCredentialsResultInner>() { + @Override + public RegistryListCredentialsResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Regenerates one of the login credentials for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param name Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'password', 'password2' + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryListCredentialsResultInner object + */ + public Observable> regenerateCredentialWithServiceResponseAsync(String resourceGroupName, String registryName, PasswordName name) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (name == null) { + throw new IllegalArgumentException("Parameter name is required and cannot be null."); + } + final String apiVersion = "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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = regenerateCredentialDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse regenerateCredentialDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the RegistryUsageListResultInner object if successful. + */ + public RegistryUsageListResultInner listUsages(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).toBlocking().single().body(); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listUsagesAsync(String resourceGroupName, String registryName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listUsagesWithServiceResponseAsync(resourceGroupName, registryName), serviceCallback); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryUsageListResultInner object + */ + public Observable listUsagesAsync(String resourceGroupName, String registryName) { + return listUsagesWithServiceResponseAsync(resourceGroupName, registryName).map(new Func1, RegistryUsageListResultInner>() { + @Override + public RegistryUsageListResultInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the quota usages for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the RegistryUsageListResultInner object + */ + public Observable> listUsagesWithServiceResponseAsync(String resourceGroupName, String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = listUsagesDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listUsagesDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * 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, QueueBuildRequest 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, QueueBuildRequest 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, QueueBuildRequest 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, QueueBuildRequest 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, QueueBuildRequest 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, QueueBuildRequest 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, QueueBuildRequest 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, QueueBuildRequest 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. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listByResourceGroupNext(final String nextPageLink) { + ServiceResponse> response = listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listByResourceGroupNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listByResourceGroupNextAsync(final String nextPageLink) { + return listByResourceGroupNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listByResourceGroupNextWithServiceResponseAsync(final String nextPageLink) { + return listByResourceGroupNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listByResourceGroupNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified resource group. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listByResourceGroupNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listByResourceGroupNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<RegistryInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<RegistryInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the container registries under the specified subscription. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<RegistryInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryImpl.java new file mode 100644 index 0000000000000..74b0ff4737e3d --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryImpl.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.resources.models.implementation.GroupableResourceCoreImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Registry; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryUpdateParameters; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Status; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.StorageAccountProperties; +import rx.functions.Func1; + +class RegistryImpl extends GroupableResourceCoreImpl implements Registry, Registry.Definition, Registry.Update { + private RegistryUpdateParameters updateParameter; + RegistryImpl(String name, RegistryInner inner, ContainerRegistryManager manager) { + super(name, inner, manager); + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Observable createResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.createAsync(this.resourceGroupName(), this.name(), this.inner()) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.updateAsync(this.resourceGroupName(), this.name(), this.updateParameter) + .map(new Func1() { + @Override + public RegistryInner call(RegistryInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + RegistriesInner client = this.manager().inner().registries(); + return client.getByResourceGroupAsync(this.resourceGroupName(), this.name()); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.updateParameter = new RegistryUpdateParameters(); + } + + @Override + public Boolean adminUserEnabled() { + return this.inner().adminUserEnabled(); + } + + @Override + public DateTime creationDate() { + return this.inner().creationDate(); + } + + @Override + public String loginServer() { + return this.inner().loginServer(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Sku sku() { + return this.inner().sku(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public StorageAccountProperties storageAccount() { + return this.inner().storageAccount(); + } + + @Override + public RegistryImpl withSku(Sku sku) { + if (isInCreateMode()) { + this.inner().withSku(sku); + } else { + this.updateParameter.withSku(sku); + } + return this; + } + + @Override + public RegistryImpl withAdminUserEnabled(Boolean adminUserEnabled) { + if (isInCreateMode()) { + this.inner().withAdminUserEnabled(adminUserEnabled); + } else { + this.updateParameter.withAdminUserEnabled(adminUserEnabled); + } + return this; + } + + @Override + public RegistryImpl withStorageAccount(StorageAccountProperties storageAccount) { + if (isInCreateMode()) { + this.inner().withStorageAccount(storageAccount); + } else { + this.updateParameter.withStorageAccount(storageAccount); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryInner.java new file mode 100644 index 0000000000000..ebfd71e2d02c1 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryInner.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Sku; +import org.joda.time.DateTime; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Status; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.StorageAccountProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a container registry. + */ +@JsonFlatten +public class RegistryInner extends Resource { + /** + * The SKU of the container registry. + */ + @JsonProperty(value = "sku", required = true) + private Sku sku; + + /** + * The URL that can be used to log into the container registry. + */ + @JsonProperty(value = "properties.loginServer", access = JsonProperty.Access.WRITE_ONLY) + private String loginServer; + + /** + * The creation date of the container registry in ISO8601 format. + */ + @JsonProperty(value = "properties.creationDate", access = JsonProperty.Access.WRITE_ONLY) + private DateTime creationDate; + + /** + * The provisioning state of the container registry at the time the + * operation was called. Possible values include: 'Creating', 'Updating', + * 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the container registry at the time the operation was + * called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /** + * The value that indicates whether the admin user is enabled. + */ + @JsonProperty(value = "properties.adminUserEnabled") + private Boolean adminUserEnabled; + + /** + * The properties of the storage account for the container registry. Only + * applicable to Classic SKU. + */ + @JsonProperty(value = "properties.storageAccount") + private StorageAccountProperties storageAccount; + + /** + * Get the SKU of the container registry. + * + * @return the sku value + */ + public Sku sku() { + return this.sku; + } + + /** + * Set the SKU of the container registry. + * + * @param sku the sku value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withSku(Sku sku) { + this.sku = sku; + return this; + } + + /** + * Get the URL that can be used to log into the container registry. + * + * @return the loginServer value + */ + public String loginServer() { + return this.loginServer; + } + + /** + * Get the creation date of the container registry in ISO8601 format. + * + * @return the creationDate value + */ + public DateTime creationDate() { + return this.creationDate; + } + + /** + * Get the provisioning state of the container registry at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the container registry at the time the operation was called. + * + * @return the status value + */ + public Status status() { + return this.status; + } + + /** + * Get the value that indicates whether the admin user is enabled. + * + * @return the adminUserEnabled value + */ + public Boolean adminUserEnabled() { + return this.adminUserEnabled; + } + + /** + * Set the value that indicates whether the admin user is enabled. + * + * @param adminUserEnabled the adminUserEnabled value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withAdminUserEnabled(Boolean adminUserEnabled) { + this.adminUserEnabled = adminUserEnabled; + return this; + } + + /** + * Get the properties of the storage account for the container registry. Only applicable to Classic SKU. + * + * @return the storageAccount value + */ + public StorageAccountProperties storageAccount() { + return this.storageAccount; + } + + /** + * Set the properties of the storage account for the container registry. Only applicable to Classic SKU. + * + * @param storageAccount the storageAccount value to set + * @return the RegistryInner object itself. + */ + public RegistryInner withStorageAccount(StorageAccountProperties storageAccount) { + this.storageAccount = storageAccount; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryListCredentialsResultImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryListCredentialsResultImpl.java new file mode 100644 index 0000000000000..d6576503701df --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryListCredentialsResultImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryListCredentialsResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryPassword; + +class RegistryListCredentialsResultImpl extends WrapperImpl implements RegistryListCredentialsResult { + private final ContainerRegistryManager manager; + RegistryListCredentialsResultImpl(RegistryListCredentialsResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List passwords() { + return this.inner().passwords(); + } + + @Override + public String username() { + return this.inner().username(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryListCredentialsResultInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryListCredentialsResultInner.java new file mode 100644 index 0000000000000..5381082884968 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryListCredentialsResultInner.java @@ -0,0 +1,71 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryPassword; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The response from the ListCredentials operation. + */ +public class RegistryListCredentialsResultInner { + /** + * The username for a container registry. + */ + @JsonProperty(value = "username") + private String username; + + /** + * The list of passwords for a container registry. + */ + @JsonProperty(value = "passwords") + private List passwords; + + /** + * Get the username for a container registry. + * + * @return the username value + */ + public String username() { + return this.username; + } + + /** + * Set the username for a container registry. + * + * @param username the username value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withUsername(String username) { + this.username = username; + return this; + } + + /** + * Get the list of passwords for a container registry. + * + * @return the passwords value + */ + public List passwords() { + return this.passwords; + } + + /** + * Set the list of passwords for a container registry. + * + * @param passwords the passwords value to set + * @return the RegistryListCredentialsResultInner object itself. + */ + public RegistryListCredentialsResultInner withPasswords(List passwords) { + this.passwords = passwords; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryNameStatusImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryNameStatusImpl.java new file mode 100644 index 0000000000000..467d8357fb567 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryNameStatusImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryNameStatus; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class RegistryNameStatusImpl extends WrapperImpl implements RegistryNameStatus { + private final ContainerRegistryManager manager; + RegistryNameStatusImpl(RegistryNameStatusInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String message() { + return this.inner().message(); + } + + @Override + public Boolean nameAvailable() { + return this.inner().nameAvailable(); + } + + @Override + public String reason() { + return this.inner().reason(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryNameStatusInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryNameStatusInner.java new file mode 100644 index 0000000000000..544f8ccb7567a --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryNameStatusInner.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to check the availability of a container registry + * name. + */ +public class RegistryNameStatusInner { + /** + * The value that indicates whether the name is available. + */ + @JsonProperty(value = "nameAvailable") + private Boolean nameAvailable; + + /** + * If any, the reason that the name is not available. + */ + @JsonProperty(value = "reason") + private String reason; + + /** + * If any, the error message that provides more detail for the reason that + * the name is not available. + */ + @JsonProperty(value = "message") + private String message; + + /** + * Get the value that indicates whether the name is available. + * + * @return the nameAvailable value + */ + public Boolean nameAvailable() { + return this.nameAvailable; + } + + /** + * Set the value that indicates whether the name is available. + * + * @param nameAvailable the nameAvailable value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withNameAvailable(Boolean nameAvailable) { + this.nameAvailable = nameAvailable; + return this; + } + + /** + * Get if any, the reason that the name is not available. + * + * @return the reason value + */ + public String reason() { + return this.reason; + } + + /** + * Set if any, the reason that the name is not available. + * + * @param reason the reason value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withReason(String reason) { + this.reason = reason; + return this; + } + + /** + * Get if any, the error message that provides more detail for the reason that the name is not available. + * + * @return the message value + */ + public String message() { + return this.message; + } + + /** + * Set if any, the error message that provides more detail for the reason that the name is not available. + * + * @param message the message value to set + * @return the RegistryNameStatusInner object itself. + */ + public RegistryNameStatusInner withMessage(String message) { + this.message = message; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryUsageListResultImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryUsageListResultImpl.java new file mode 100644 index 0000000000000..cf86b80bd06f2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryUsageListResultImpl.java @@ -0,0 +1,33 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryUsageListResult; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryUsage; + +class RegistryUsageListResultImpl extends WrapperImpl implements RegistryUsageListResult { + private final ContainerRegistryManager manager; + RegistryUsageListResultImpl(RegistryUsageListResultInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public List value() { + return this.inner().value(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryUsageListResultInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryUsageListResultInner.java new file mode 100644 index 0000000000000..e663c103a568e --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/RegistryUsageListResultInner.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.RegistryUsage; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The result of a request to get container registry quota usages. + */ +public class RegistryUsageListResultInner { + /** + * The list of container registry quota usages. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the list of container registry quota usages. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the list of container registry quota usages. + * + * @param value the value value to set + * @return the RegistryUsageListResultInner object itself. + */ + public RegistryUsageListResultInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationImpl.java new file mode 100644 index 0000000000000..90701d545b72c --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationImpl.java @@ -0,0 +1,129 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replication; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import java.util.Map; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Status; + +class ReplicationImpl extends CreatableUpdatableImpl implements Replication, Replication.Definition, Replication.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String replicationName; + + ReplicationImpl(String name, ContainerRegistryManager manager) { + super(name, new ReplicationInner()); + this.manager = manager; + // Set resource name + this.replicationName = name; + // + } + + ReplicationImpl(ReplicationInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.replicationName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.replicationName = IdParsingUtils.getValueFromIdByName(inner.id(), "replications"); + // + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.createAsync(this.resourceGroupName, this.registryName, this.replicationName, this.inner()) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + ReplicationsInner client = this.manager().inner().replications(); + return client.getAsync(this.resourceGroupName, this.registryName, this.replicationName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public Status status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public ReplicationImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public ReplicationImpl withLocation(String location) { + this.inner().withLocation(location); + return this; + } + + @Override + public ReplicationImpl withTags(Map tags) { + this.inner().withTags(tags); + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationInner.java new file mode 100644 index 0000000000000..96de8bcd283a2 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationInner.java @@ -0,0 +1,54 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Status; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a replication for a container registry. + */ +@JsonFlatten +public class ReplicationInner extends Resource { + /** + * The provisioning state of the replication at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * The status of the replication at the time the operation was called. + */ + @JsonProperty(value = "properties.status", access = JsonProperty.Access.WRITE_ONLY) + private Status status; + + /** + * Get the provisioning state of the replication at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the status of the replication at the time the operation was called. + * + * @return the status value + */ + public Status status() { + return this.status; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationsImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationsImpl.java new file mode 100644 index 0000000000000..922168386d38f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationsImpl.java @@ -0,0 +1,81 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replication; + +class ReplicationsImpl extends WrapperImpl implements Replications { + private final ContainerRegistryManager manager; + + ReplicationsImpl(ContainerRegistryManager manager) { + super(manager.inner().replications()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public ReplicationImpl define(String name) { + return wrapModel(name); + } + + private ReplicationImpl wrapModel(ReplicationInner inner) { + return new ReplicationImpl(inner, manager()); + } + + private ReplicationImpl wrapModel(String name) { + return new ReplicationImpl(name, this.manager()); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + ReplicationsInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, replicationName) + .map(new Func1() { + @Override + public Replication call(ReplicationInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + ReplicationsInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, replicationName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationsInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationsInner.java new file mode 100644 index 0000000000000..182525c5af71d --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/ReplicationsInner.java @@ -0,0 +1,1118 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ReplicationUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Replications. + */ +public class ReplicationsInner { + /** The Retrofit service to perform REST calls. */ + private ReplicationsService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of ReplicationsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public ReplicationsInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(ReplicationsService.class); + this.client = client; + } + + /** + * The interface defining all the services for Replications to be + * used by Retrofit to perform actually REST calls. + */ + interface ReplicationsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Body ReplicationInner replication, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("replicationName") String replicationName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body ReplicationUpdateParameters replicationUpdateParameters, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Replications listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner get(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String replicationName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified replication. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner create(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().last().body(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return createWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (replication == null) { + throw new IllegalArgumentException("Parameter replication is required and cannot be null."); + } + Validator.validate(replication); + final String apiVersion = "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()); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginCreate(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).toBlocking().single().body(); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication), serviceCallback); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, replication).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param replication The parameters for creating a replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, ReplicationInner replication) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + if (replication == null) { + throw new IllegalArgumentException("Parameter replication is required and cannot be null."); + } + Validator.validate(replication); + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String replicationName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String replicationName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "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()); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String replicationName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String replicationName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a replication from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().last().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + final Map tags = null; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(null); + Observable> observable = service.update(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner update(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().last().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "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()); + return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken() { }.getType()); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).toBlocking().single().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + final String apiVersion = "2017-10-01"; + final Map tags = null; + ReplicationUpdateParameters replicationUpdateParameters = new ReplicationUpdateParameters(); + replicationUpdateParameters.withTags(null); + return service.beginUpdate(this.client.subscriptionId(), resourceGroupName, registryName, replicationName, apiVersion, this.client.acceptLanguage(), replicationUpdateParameters, this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the ReplicationInner object if successful. + */ + public ReplicationInner beginUpdate(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).toBlocking().single().body(); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags), serviceCallback); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, replicationName, tags).map(new Func1, ReplicationInner>() { + @Override + public ReplicationInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a replication for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param replicationName The name of the replication. + * @param tags The tags for the replication. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the ReplicationInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String replicationName, Map tags) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (replicationName == null) { + throw new IllegalArgumentException("Parameter replicationName is required and cannot be null."); + } + Validator.validate(tags); + final String apiVersion = "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()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ReplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<ReplicationInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<ReplicationInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the replications for the specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<ReplicationInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceRepositoryPropertiesImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceRepositoryPropertiesImpl.java new file mode 100644 index 0000000000000..28a311878c735 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceRepositoryPropertiesImpl.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.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceRepositoryProperties; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceControlAuthInfo; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceControlType; + +class SourceRepositoryPropertiesImpl extends WrapperImpl implements SourceRepositoryProperties { + private final ContainerRegistryManager manager; + SourceRepositoryPropertiesImpl(SourceRepositoryPropertiesInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Boolean isCommitTriggerEnabled() { + return this.inner().isCommitTriggerEnabled(); + } + + @Override + public String repositoryUrl() { + return this.inner().repositoryUrl(); + } + + @Override + public SourceControlAuthInfo sourceControlAuthProperties() { + return this.inner().sourceControlAuthProperties(); + } + + @Override + public SourceControlType sourceControlType() { + return this.inner().sourceControlType(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceRepositoryPropertiesInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceRepositoryPropertiesInner.java new file mode 100644 index 0000000000000..21ebd29b678e1 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/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.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceControlType; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.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 type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @return the sourceControlType value + */ + public SourceControlType sourceControlType() { + return this.sourceControlType; + } + + /** + * Set the type of source control service. Possible values include: 'Github', 'VisualStudioTeamService'. + * + * @param sourceControlType the sourceControlType value to set + * @return the SourceRepositoryPropertiesInner object itself. + */ + public SourceRepositoryPropertiesInner withSourceControlType(SourceControlType sourceControlType) { + this.sourceControlType = sourceControlType; + return this; + } + + /** + * Get the full URL to the source code respository. + * + * @return the repositoryUrl value + */ + public String repositoryUrl() { + return this.repositoryUrl; + } + + /** + * Set the full URL to the source code respository. + * + * @param repositoryUrl the repositoryUrl value to set + * @return the SourceRepositoryPropertiesInner object itself. + */ + public SourceRepositoryPropertiesInner withRepositoryUrl(String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get the value of this property indicates whether the source control commit trigger is enabled or not. + * + * @return the isCommitTriggerEnabled value + */ + public Boolean isCommitTriggerEnabled() { + return this.isCommitTriggerEnabled; + } + + /** + * Set the value of this property indicates whether the source control commit trigger is enabled or not. + * + * @param isCommitTriggerEnabled the isCommitTriggerEnabled value to set + * @return the SourceRepositoryPropertiesInner object itself. + */ + public SourceRepositoryPropertiesInner withIsCommitTriggerEnabled(Boolean isCommitTriggerEnabled) { + this.isCommitTriggerEnabled = isCommitTriggerEnabled; + return this; + } + + /** + * Get the authorization properties for accessing the source code repository. + * + * @return the sourceControlAuthProperties value + */ + public SourceControlAuthInfo sourceControlAuthProperties() { + return this.sourceControlAuthProperties; + } + + /** + * Set the authorization properties for accessing the source code repository. + * + * @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/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceUploadDefinitionImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceUploadDefinitionImpl.java new file mode 100644 index 0000000000000..34a90c01ddd81 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceUploadDefinitionImpl.java @@ -0,0 +1,36 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.SourceUploadDefinition; +import com.microsoft.azure.arm.model.implementation.WrapperImpl; + +class SourceUploadDefinitionImpl extends WrapperImpl implements SourceUploadDefinition { + private final ContainerRegistryManager manager; + SourceUploadDefinitionImpl(SourceUploadDefinitionInner inner, ContainerRegistryManager manager) { + super(inner); + this.manager = manager; + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public String relativePath() { + return this.inner().relativePath(); + } + + @Override + public String uploadUrl() { + return this.inner().uploadUrl(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceUploadDefinitionInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceUploadDefinitionInner.java new file mode 100644 index 0000000000000..ec76616d46698 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/SourceUploadDefinitionInner.java @@ -0,0 +1,70 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * The properties of a response to source upload request. + */ +public class SourceUploadDefinitionInner { + /** + * The URL where the client can upload the source. + */ + @JsonProperty(value = "uploadUrl") + private String uploadUrl; + + /** + * The relative path to the source. This is used to submit the subsequent + * queue build request. + */ + @JsonProperty(value = "relativePath") + private String relativePath; + + /** + * Get the URL where the client can upload the source. + * + * @return the uploadUrl value + */ + public String uploadUrl() { + return this.uploadUrl; + } + + /** + * Set the URL where the client can upload the source. + * + * @param uploadUrl the uploadUrl value to set + * @return the SourceUploadDefinitionInner object itself. + */ + public SourceUploadDefinitionInner withUploadUrl(String uploadUrl) { + this.uploadUrl = uploadUrl; + return this; + } + + /** + * Get the relative path to the source. This is used to submit the subsequent queue build request. + * + * @return the relativePath value + */ + public String relativePath() { + return this.relativePath; + } + + /** + * Set the relative path to the source. This is used to submit the subsequent queue build request. + * + * @param relativePath the relativePath value to set + * @return the SourceUploadDefinitionInner object itself. + */ + public SourceUploadDefinitionInner withRelativePath(String relativePath) { + this.relativePath = relativePath; + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhookImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhookImpl.java new file mode 100644 index 0000000000000..f1fa38b5c4b21 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhookImpl.java @@ -0,0 +1,222 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhook; +import com.microsoft.azure.arm.model.implementation.CreatableUpdatableImpl; +import rx.Observable; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.WebhookUpdateParameters; +import java.util.Map; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.WebhookStatus; +import rx.functions.Func1; + +class WebhookImpl extends CreatableUpdatableImpl implements Webhook, Webhook.Definition, Webhook.Update { + private final ContainerRegistryManager manager; + private String resourceGroupName; + private String registryName; + private String webhookName; + private WebhookCreateParameters createParameter; + private WebhookUpdateParameters updateParameter; + + WebhookImpl(String name, ContainerRegistryManager manager) { + super(name, new WebhookInner()); + this.manager = manager; + // Set resource name + this.webhookName = name; + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + WebhookImpl(WebhookInner inner, ContainerRegistryManager manager) { + super(inner.name(), inner); + this.manager = manager; + // Set resource name + this.webhookName = inner.name(); + // resource ancestor names + this.resourceGroupName = IdParsingUtils.getValueFromIdByName(inner.id(), "resourceGroups"); + this.registryName = IdParsingUtils.getValueFromIdByName(inner.id(), "registries"); + this.webhookName = IdParsingUtils.getValueFromIdByName(inner.id(), "webhooks"); + // + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public Observable createResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.createAsync(this.resourceGroupName, this.registryName, this.webhookName, this.createParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + public Observable updateResourceAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.updateAsync(this.resourceGroupName, this.registryName, this.webhookName, this.updateParameter) + .map(new Func1() { + @Override + public WebhookInner call(WebhookInner resource) { + resetCreateUpdateParameters(); + return resource; + } + }) + .map(innerToFluentMap(this)); + } + + @Override + protected Observable getInnerAsync() { + WebhooksInner client = this.manager().inner().webhooks(); + return client.getAsync(this.resourceGroupName, this.registryName, this.webhookName); + } + + @Override + public boolean isInCreateMode() { + return this.inner().id() == null; + } + + private void resetCreateUpdateParameters() { + this.createParameter = new WebhookCreateParameters(); + this.updateParameter = new WebhookUpdateParameters(); + } + + @Override + public List actions() { + return this.inner().actions(); + } + + @Override + public String id() { + return this.inner().id(); + } + + @Override + public String location() { + return this.inner().location(); + } + + @Override + public String name() { + return this.inner().name(); + } + + @Override + public ProvisioningState provisioningState() { + return this.inner().provisioningState(); + } + + @Override + public String scope() { + return this.inner().scope(); + } + + @Override + public WebhookStatus status() { + return this.inner().status(); + } + + @Override + public Map tags() { + return this.inner().getTags(); + } + + @Override + public String type() { + return this.inner().type(); + } + + @Override + public WebhookImpl withExistingRegistry(String resourceGroupName, String registryName) { + this.resourceGroupName = resourceGroupName; + this.registryName = registryName; + return this; + } + + @Override + public WebhookImpl withLocation(String location) { + this.createParameter.withLocation(location); + return this; + } + + @Override + public WebhookImpl withActions(List actions) { + if (isInCreateMode()) { + this.createParameter.withActions(actions); + } else { + this.updateParameter.withActions(actions); + } + return this; + } + + @Override + public WebhookImpl withServiceUri(String serviceUri) { + if (isInCreateMode()) { + this.createParameter.withServiceUri(serviceUri); + } else { + this.updateParameter.withServiceUri(serviceUri); + } + return this; + } + + @Override + public WebhookImpl withCustomHeaders(Map customHeaders) { + if (isInCreateMode()) { + this.createParameter.withCustomHeaders(customHeaders); + } else { + this.updateParameter.withCustomHeaders(customHeaders); + } + return this; + } + + @Override + public WebhookImpl withScope(String scope) { + if (isInCreateMode()) { + this.createParameter.withScope(scope); + } else { + this.updateParameter.withScope(scope); + } + return this; + } + + @Override + public WebhookImpl withStatus(WebhookStatus status) { + if (isInCreateMode()) { + this.createParameter.withStatus(status); + } else { + this.updateParameter.withStatus(status); + } + return this; + } + + @Override + public WebhookImpl withTags(Map tags) { + if (isInCreateMode()) { + this.createParameter.withTags(tags); + } else { + this.updateParameter.withTags(tags); + } + return this; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhookInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhookInner.java new file mode 100644 index 0000000000000..ad71c0fb7d42c --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhookInner.java @@ -0,0 +1,123 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.WebhookStatus; +import java.util.List; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.WebhookAction; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.ProvisioningState; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * An object that represents a webhook for a container registry. + */ +@JsonFlatten +public class WebhookInner extends Resource { + /** + * The status of the webhook at the time the operation was called. Possible + * values include: 'enabled', 'disabled'. + */ + @JsonProperty(value = "properties.status") + private WebhookStatus status; + + /** + * The scope of repositories where the event can be triggered. For example, + * 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' + * means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. + * Empty means all events. + */ + @JsonProperty(value = "properties.scope") + private String scope; + + /** + * The list of actions that trigger the webhook to post notifications. + */ + @JsonProperty(value = "properties.actions", required = true) + private List actions; + + /** + * The provisioning state of the webhook at the time the operation was + * called. Possible values include: 'Creating', 'Updating', 'Deleting', + * 'Succeeded', 'Failed', 'Canceled'. + */ + @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY) + private ProvisioningState provisioningState; + + /** + * Get the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @return the status value + */ + public WebhookStatus status() { + return this.status; + } + + /** + * Set the status of the webhook at the time the operation was called. Possible values include: 'enabled', 'disabled'. + * + * @param status the status value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withStatus(WebhookStatus status) { + this.status = status; + return this; + } + + /** + * Get the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @return the scope value + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + * + * @param scope the scope value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the list of actions that trigger the webhook to post notifications. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the list of actions that trigger the webhook to post notifications. + * + * @param actions the actions value to set + * @return the WebhookInner object itself. + */ + public WebhookInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the provisioning state of the webhook at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'. + * + * @return the provisioningState value + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhooksImpl.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhooksImpl.java new file mode 100644 index 0000000000000..7c557110626ff --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhooksImpl.java @@ -0,0 +1,126 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import com.microsoft.azure.arm.model.implementation.WrapperImpl; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks; +import rx.Completable; +import rx.Observable; +import rx.functions.Func1; +import com.microsoft.azure.Page; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.EventInfo; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.CallbackConfig; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Event; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhook; + +class WebhooksImpl extends WrapperImpl implements Webhooks { + private final ContainerRegistryManager manager; + + WebhooksImpl(ContainerRegistryManager manager) { + super(manager.inner().webhooks()); + this.manager = manager; + } + + public ContainerRegistryManager manager() { + return this.manager; + } + + @Override + public WebhookImpl define(String name) { + return wrapModel(name); + } + + private WebhookImpl wrapModel(WebhookInner inner) { + return new WebhookImpl(inner, manager()); + } + + private WebhookImpl wrapModel(String name) { + return new WebhookImpl(name, this.manager()); + } + + @Override + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.pingAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public EventInfo call(EventInfoInner inner) { + return new EventInfoImpl(inner, manager()); + } + }); + } + + @Override + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getCallbackConfigAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public CallbackConfig call(CallbackConfigInner inner) { + return new CallbackConfigImpl(inner, manager()); + } + }); + } + + @Override + public Observable listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + WebhooksInner client = this.inner(); + return client.listEventsAsync(resourceGroupName, registryName, webhookName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Event call(EventInner inner) { + return new EventImpl(inner, manager()); + } + }); + } + + @Override + public Observable listAsync(final String resourceGroupName, final String registryName) { + WebhooksInner client = this.inner(); + return client.listAsync(resourceGroupName, registryName) + .flatMapIterable(new Func1, Iterable>() { + @Override + public Iterable call(Page page) { + return page.items(); + } + }) + .map(new Func1() { + @Override + public Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.getAsync(resourceGroupName, registryName, webhookName) + .map(new Func1() { + @Override + public Webhook call(WebhookInner inner) { + return wrapModel(inner); + } + }); + } + + @Override + public Completable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + WebhooksInner client = this.inner(); + return client.deleteAsync(resourceGroupName, registryName, webhookName).toCompletable(); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhooksInner.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhooksInner.java new file mode 100644 index 0000000000000..782d9e3c371a1 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/WebhooksInner.java @@ -0,0 +1,1396 @@ +/** + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + */ + +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.AzureServiceFuture; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.ListOperationCallback; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.WebhookCreateParameters; +import com.microsoft.azure.management.containerregistry.v2018_02_01_preview.WebhookUpdateParameters; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.POST; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.http.Url; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in Webhooks. + */ +public class WebhooksInner { + /** The Retrofit service to perform REST calls. */ + private WebhooksService service; + /** The service client containing this operation class. */ + private ContainerRegistryManagementClientImpl client; + + /** + * Initializes an instance of WebhooksInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public WebhooksInner(Retrofit retrofit, ContainerRegistryManagementClientImpl client) { + this.service = retrofit.create(WebhooksService.class); + this.client = client; + } + + /** + * The interface defining all the services for Webhooks to be + * used by Retrofit to perform actually REST calls. + */ + interface WebhooksService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks get" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> get(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks create" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> create(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks beginCreate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginCreate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookCreateParameters webhookCreateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks beginDelete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", method = "DELETE", hasBody = true) + Observable> beginDelete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks beginUpdate" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}") + Observable> beginUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Body WebhookUpdateParameters webhookUpdateParameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks ping" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping") + Observable> ping(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks getCallbackConfig" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig") + Observable> getCallbackConfig(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks listEvents" }) + @POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents") + Observable> listEvents(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("registryName") String registryName, @Path("webhookName") String webhookName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks listNext" }) + @GET + Observable> listNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.containerregistry.v2018_02_01_preview.Webhooks listEventsNext" }) + @GET + Observable> listEventsNext(@Url String nextUrl, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner get(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable getAsync(String resourceGroupName, String registryName, String webhookName) { + return getWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the properties of the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> getWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = getDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner create(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().last().body(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable createAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return createWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> createWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookCreateParameters == null) { + throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); + } + Validator.validate(webhookCreateParameters); + final String apiVersion = "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()); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginCreate(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).toBlocking().single().body(); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters), serviceCallback); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginCreateAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + return beginCreateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookCreateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Creates a webhook for a container registry with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookCreateParameters The parameters for creating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginCreateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookCreateParameters webhookCreateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookCreateParameters == null) { + throw new IllegalArgumentException("Parameter webhookCreateParameters is required and cannot be null."); + } + Validator.validate(webhookCreateParameters); + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = beginCreateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginCreateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String registryName, String webhookName) { + deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().last().body(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable deleteAsync(String resourceGroupName, String registryName, String webhookName) { + return deleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "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()); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void beginDelete(String resourceGroupName, String registryName, String webhookName) { + beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginDeleteAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable beginDeleteAsync(String resourceGroupName, String registryName, String webhookName) { + return beginDeleteWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Deletes a webhook from a container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> beginDeleteWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = beginDeleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginDeleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(202, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner update(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().last().body(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable updateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return updateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable for the request + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookUpdateParameters == null) { + throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); + } + Validator.validate(webhookUpdateParameters); + final String apiVersion = "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()); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the WebhookInner object if successful. + */ + public WebhookInner beginUpdate(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).toBlocking().single().body(); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters), serviceCallback); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable beginUpdateAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + return beginUpdateWithServiceResponseAsync(resourceGroupName, registryName, webhookName, webhookUpdateParameters).map(new Func1, WebhookInner>() { + @Override + public WebhookInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Updates a webhook with the specified parameters. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param webhookUpdateParameters The parameters for updating a webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the WebhookInner object + */ + public Observable> beginUpdateWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName, WebhookUpdateParameters webhookUpdateParameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + if (webhookUpdateParameters == null) { + throw new IllegalArgumentException("Parameter webhookUpdateParameters is required and cannot be null."); + } + Validator.validate(webhookUpdateParameters); + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = beginUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse beginUpdateDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(201, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> object if successful. + */ + public PagedList list(final String resourceGroupName, final String registryName) { + ServiceResponse> response = listSinglePageAsync(resourceGroupName, registryName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final String resourceGroupName, final String registryName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listSinglePageAsync(resourceGroupName, registryName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable> listAsync(final String resourceGroupName, final String registryName) { + return listWithServiceResponseAsync(resourceGroupName, registryName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable>> listWithServiceResponseAsync(final String resourceGroupName, final String registryName) { + return listSinglePageAsync(resourceGroupName, registryName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebhookInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listSinglePageAsync(final String resourceGroupName, final String registryName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse> result = listDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the EventInfoInner object if successful. + */ + public EventInfoInner ping(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture pingAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable pingAsync(String resourceGroupName, String registryName, String webhookName) { + return pingWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, EventInfoInner>() { + @Override + public EventInfoInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Triggers a ping event to be sent to the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the EventInfoInner object + */ + public Observable> pingWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = pingDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse pingDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the CallbackConfigInner object if successful. + */ + public CallbackConfigInner getCallbackConfig(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).toBlocking().single().body(); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName), serviceCallback); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable getCallbackConfigAsync(String resourceGroupName, String registryName, String webhookName) { + return getCallbackConfigWithServiceResponseAsync(resourceGroupName, registryName, webhookName).map(new Func1, CallbackConfigInner>() { + @Override + public CallbackConfigInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Gets the configuration of service URI and custom headers for the webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the CallbackConfigInner object + */ + public Observable> getCallbackConfigWithServiceResponseAsync(String resourceGroupName, String registryName, String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse clientResponse = getCallbackConfigDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getCallbackConfigDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEvents(final String resourceGroupName, final String registryName, final String webhookName) { + ServiceResponse> response = listEventsSinglePageAsync(resourceGroupName, registryName, webhookName).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsSinglePageAsync(resourceGroupName, registryName, webhookName), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsWithServiceResponseAsync(resourceGroupName, registryName, webhookName) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsWithServiceResponseAsync(final String resourceGroupName, final String registryName, final String webhookName) { + return listEventsSinglePageAsync(resourceGroupName, registryName, webhookName) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param resourceGroupName The name of the resource group to which the container registry belongs. + ServiceResponse> * @param registryName The name of the container registry. + ServiceResponse> * @param webhookName The name of the webhook. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsSinglePageAsync(final String resourceGroupName, final String registryName, final String webhookName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (registryName == null) { + throw new IllegalArgumentException("Parameter registryName is required and cannot be null."); + } + if (webhookName == null) { + throw new IllegalArgumentException("Parameter webhookName is required and cannot be null."); + } + final String apiVersion = "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) { + try { + ServiceResponse> result = listEventsDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<WebhookInner> object if successful. + */ + public PagedList listNext(final String nextPageLink) { + ServiceResponse> response = listNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable> listNextAsync(final String nextPageLink) { + return listNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<WebhookInner> object + */ + public Observable>> listNextWithServiceResponseAsync(final String nextPageLink) { + return listNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists all the webhooks for the specified container registry. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<WebhookInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the PagedList<EventInner> object if successful. + */ + public PagedList listEventsNext(final String nextPageLink) { + ServiceResponse> response = listEventsNextSinglePageAsync(nextPageLink).toBlocking().single(); + return new PagedList(response.body()) { + @Override + public Page nextPage(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink).toBlocking().single().body(); + } + }; + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @param serviceFuture the ServiceFuture object tracking the Retrofit calls + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listEventsNextAsync(final String nextPageLink, final ServiceFuture> serviceFuture, final ListOperationCallback serviceCallback) { + return AzureServiceFuture.fromPageResponse( + listEventsNextSinglePageAsync(nextPageLink), + new Func1>>>() { + @Override + public Observable>> call(String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink); + } + }, + serviceCallback); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable> listEventsNextAsync(final String nextPageLink) { + return listEventsNextWithServiceResponseAsync(nextPageLink) + .map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + return response.body(); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the PagedList<EventInner> object + */ + public Observable>> listEventsNextWithServiceResponseAsync(final String nextPageLink) { + return listEventsNextSinglePageAsync(nextPageLink) + .concatMap(new Func1>, Observable>>>() { + @Override + public Observable>> call(ServiceResponse> page) { + String nextPageLink = page.body().nextPageLink(); + if (nextPageLink == null) { + return Observable.just(page); + } + return Observable.just(page).concatWith(listEventsNextWithServiceResponseAsync(nextPageLink)); + } + }); + } + + /** + * Lists recent events for the specified webhook. + * + ServiceResponse> * @param nextPageLink The NextLink from the previous successful call to List operation. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the PagedList<EventInner> object wrapped in {@link ServiceResponse} if successful. + */ + public Observable>> listEventsNextSinglePageAsync(final String nextPageLink) { + if (nextPageLink == null) { + throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null."); + } + String nextUrl = String.format("%s", nextPageLink); + return service.listEventsNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listEventsNextDelegate(response); + return Observable.just(new ServiceResponse>(result.body(), result.response())); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listEventsNextDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., CloudException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/package-info.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/package-info.java new file mode 100644 index 0000000000000..406f1fbef918f --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/implementation/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the implementation classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview.implementation; diff --git a/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/package-info.java b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/package-info.java new file mode 100644 index 0000000000000..ca6853d44e007 --- /dev/null +++ b/containerregistry/resource-manager/v2018_02_01_preview/src/main/java/com/microsoft/azure/management/containerregistry/v2018_02_01_preview/package-info.java @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. + +/** + * This package contains the classes for ContainerRegistryManagementClient. + */ +package com.microsoft.azure.management.containerregistry.v2018_02_01_preview;